[FFmpeg-cvslog] vc1: Return stream format information from parser

Mark Thompson git at videolan.org
Mon Oct 31 21:43:44 EET 2016


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Sun Oct 23 18:42:22 2016 +0100| [4df6605da7e351116c99f19b8a98e1f236932600] | committer: Mark Thompson

vc1: Return stream format information from parser

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4df6605da7e351116c99f19b8a98e1f236932600
---

 libavcodec/vc1_parser.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavcodec/vc1_parser.c b/libavcodec/vc1_parser.c
index 9ca6154..bb54947 100644
--- a/libavcodec/vc1_parser.c
+++ b/libavcodec/vc1_parser.c
@@ -115,6 +115,14 @@ static void vc1_extract_header(AVCodecParserContext *s, AVCodecContext *avctx,
     }
     if (avctx->framerate.num)
         avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
+    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,



More information about the ffmpeg-cvslog mailing list