]> git.sesse.net Git - ffmpeg/commitdiff
vc1: Return stream format information from parser
authorMark Thompson <sw@jkqxz.net>
Wed, 26 Oct 2016 20:13:45 +0000 (21:13 +0100)
committerMark Thompson <sw@jkqxz.net>
Mon, 14 Nov 2016 19:38:19 +0000 (19:38 +0000)
libavcodec/vc1_parser.c

index 38b62f72bd7aeb254b8f797895df98cb8b2edc07..7234db69ae68aadf20d32593be0a41e0b74d9293 100644 (file)
@@ -108,6 +108,14 @@ static void vc1_extract_header(AVCodecParserContext *s, AVCodecContext *avctx,
 
         break;
     }
+    s->format = vpc->v.chromaformat == 1 ? AV_PIX_FMT_YUV420P
+                                         : AV_PIX_FMT_NONE;
+    if (avctx->width && avctx->height) {
+        s->width        = avctx->width;
+        s->height       = avctx->height;
+        s->coded_width  = FFALIGN(avctx->coded_width,  16);
+        s->coded_height = FFALIGN(avctx->coded_height, 16);
+    }
 }
 
 static int vc1_parse(AVCodecParserContext *s,