mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
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>
This commit is contained in:
parent
822b0728f0
commit
40976257bc
@ -22,6 +22,7 @@
|
|||||||
#include "get_bits.h"
|
#include "get_bits.h"
|
||||||
#include "dsputil.h"
|
#include "dsputil.h"
|
||||||
#include "libavutil/colorspace.h"
|
#include "libavutil/colorspace.h"
|
||||||
|
#include "libavutil/imgutils.h"
|
||||||
|
|
||||||
//#define DEBUG
|
//#define DEBUG
|
||||||
|
|
||||||
@ -524,6 +525,11 @@ static int dvdsub_init(AVCodecContext *avctx)
|
|||||||
while (*p == ',' || isspace(*p))
|
while (*p == ',' || isspace(*p))
|
||||||
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 += strcspn(cur, "\n\r");
|
||||||
cur += strspn(cur, "\n\r");
|
cur += strspn(cur, "\n\r");
|
||||||
|
Loading…
Reference in New Issue
Block a user