[FFmpeg-devel] [PATCH 2/3] avcodec/cbs_bsf: use ff_cbs_read_packet_side_data() to parse extradata in packet side data

James Almer jamrial at gmail.com
Thu Aug 5 18:24:51 EEST 2021


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/cbs_bsf.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/libavcodec/cbs_bsf.c b/libavcodec/cbs_bsf.c
index 86ec3f2a4d..069f6e9918 100644
--- a/libavcodec/cbs_bsf.c
+++ b/libavcodec/cbs_bsf.c
@@ -25,15 +25,12 @@ static int cbs_bsf_update_side_data(AVBSFContext *bsf, AVPacket *pkt)
     CBSBSFContext           *ctx = bsf->priv_data;
     CodedBitstreamFragment *frag = &ctx->fragment;
     uint8_t *side_data;
-    size_t side_data_size;
     int err;
 
-    side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA,
-                                        &side_data_size);
-    if (!side_data_size)
+    if (!av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, NULL))
         return 0;
 
-    err = ff_cbs_read(ctx->input, frag, side_data, side_data_size);
+    err = ff_cbs_read_packet_side_data(ctx->input, frag, pkt);
     if (err < 0) {
         av_log(bsf, AV_LOG_ERROR,
                "Failed to read extradata from packet side data.\n");
-- 
2.32.0



More information about the ffmpeg-devel mailing list