[FFmpeg-cvslog] lavc/dvdsubdec: parse the size from the extradata.
Clément Bœsch
git at videolan.org
Tue Sep 4 23:35:57 CEST 2012
ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Tue Sep 4 17:49:15 2012 +0200| [3b6e9cd7ec72e3bd17aed4e053cef4c6a349d3db] | committer: Clément Bœsch
lavc/dvdsubdec: parse the size from the extradata.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3b6e9cd7ec72e3bd17aed4e053cef4c6a349d3db
---
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;
More information about the ffmpeg-cvslog
mailing list