]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/av1_parser: export stream dimensions in avctx
authorJames Almer <jamrial@gmail.com>
Mon, 18 Nov 2019 13:43:40 +0000 (10:43 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 29 Nov 2019 21:58:34 +0000 (18:58 -0300)
This is required to demux annexb samples when a decoder isn't available.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/av1_parser.c

index 510cad987b5a1543753c261dc55f74c793d19cf1..08721c356aa0f23649c18613525fbd1ad49c0ee0 100644 (file)
@@ -23,6 +23,7 @@
 #include "av1_parse.h"
 #include "cbs.h"
 #include "cbs_av1.h"
+#include "internal.h"
 #include "parser.h"
 
 typedef struct AV1ParseContext {
@@ -155,6 +156,12 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
             break;
         }
         av_assert2(ctx->format != AV_PIX_FMT_NONE);
+
+        if (ctx->width != avctx->width || ctx->height != avctx->height) {
+            ret = ff_set_dimensions(avctx, ctx->width, ctx->height);
+            if (ret < 0)
+                goto end;
+        }
     }
 
     if (avctx->framerate.num)