[FFmpeg-devel] [PATCH] lavc/dvdsubdec: parse the size from the extradata.

Clément Bœsch ubitux at gmail.com
Tue Sep 4 18:23:53 CEST 2012


---
 libavcodec/dvdsubdec.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 3eba2df..90593d0 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -22,6 +22,7 @@
 #include "get_bits.h"
 #include "dsputil.h"
 #include "libavutil/colorspace.h"
+#include "libavutil/imgutils.h"
 
 //#define DEBUG
 
@@ -540,6 +541,11 @@ static int dvdsub_init(AVCodecContext *avctx)
                 while(*p == ',' || isspace(*p))
                     p++;
             }
+        } else if (strncmp("size:", data, 5) == 0) {
+            int w, h;
+            if (sscanf(data + 5, "%dx%d", &w, &h) == 2 &&
+                av_image_check_size(w, h, 0, avctx) >= 0)
+                avcodec_set_dimensions(avctx, w, h);
         }
 
         data += pos;
-- 
1.7.12



More information about the ffmpeg-devel mailing list