]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/av1{dec,parser}: move to ff_cbs_read_extradata_from_codec
authorJan Ekström <jeebjp@gmail.com>
Mon, 23 Nov 2020 15:36:20 +0000 (17:36 +0200)
committerJan Ekström <jeebjp@gmail.com>
Tue, 24 Nov 2020 08:13:55 +0000 (10:13 +0200)
This lets us re-utilize the extradata-related checks in the CBS
to add support for passing the AV1CodecConfigurationRecord
as extradata as-is without further filtering.

libavcodec/av1_parser.c
libavcodec/av1dec.c

index 14826d816e84593274e41fbbf47b6e638e75a83c..181ff3a1be789f9ae14fa14529cb0c10dd6c457d 100644 (file)
@@ -73,7 +73,7 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
     if (avctx->extradata_size && !s->parsed_extradata) {
         s->parsed_extradata = 1;
 
-        ret = ff_cbs_read(s->cbc, td, avctx->extradata, avctx->extradata_size);
+        ret = ff_cbs_read_extradata_from_codec(s->cbc, td, avctx);
         if (ret < 0) {
             av_log(avctx, AV_LOG_WARNING, "Failed to parse extradata.\n");
         }
index c1967f03bd99cff995cb65ac92f410fb0dc20555..ce051d4e6d1894d51d831fc5a98e57a916a199d8 100644 (file)
@@ -616,8 +616,9 @@ static av_cold int av1_decode_init(AVCodecContext *avctx)
         return ret;
 
     if (avctx->extradata && avctx->extradata_size) {
-        ret = ff_cbs_read(s->cbc, &s->current_obu, avctx->extradata,
-                          avctx->extradata_size);
+        ret = ff_cbs_read_extradata_from_codec(s->cbc,
+                                               &s->current_obu,
+                                               avctx);
         if (ret < 0) {
             av_log(avctx, AV_LOG_WARNING, "Failed to read extradata.\n");
             return ret;