aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-01-16 18:42:16 +0100
committerLuca Barbato <lu_zero@gentoo.org>2013-01-19 15:12:58 +0100
commit40976257bc35b1649ffde3bd4598a9cf3573ebf3 (patch)
treebf4ecf09f2d88d9bd5931e41e4877356a2414b05 /libavcodec
parent822b0728f0e3c3ba60b20bd4fd971d5c4a3fe3e9 (diff)
downloadffmpeg-40976257bc35b1649ffde3bd4598a9cf3573ebf3.tar.gz
dvdsubdec: parse the size from the extradata
Signed-off-by: Alexandra Khirnova <alexandra.khirnova@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dvdsubdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index f29d278d6d..7afdd27b18 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
@@ -524,6 +525,11 @@ static int dvdsub_init(AVCodecContext *avctx)
while (*p == ',' || isspace(*p))
p++;
}
+ } else if (!strncmp("size:", cur, 5)) {
+ int w, h;
+ if (sscanf(cur + 5, "%dx%d", &w, &h) == 2 &&
+ av_image_check_size(w, h, 0, avctx) >= 0)
+ avcodec_set_dimensions(avctx, w, h);
}
cur += strcspn(cur, "\n\r");
cur += strspn(cur, "\n\r");