summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg4videodec.c
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2012-09-18 15:48:14 +0200
committerJanne Grunau <janne-libav@jannau.net>2012-09-19 19:58:15 +0200
commit8701f4f8e8a7aa71c39f0917472d22bf6a1f0f43 (patch)
tree8f8ba7cfff9d11c2754e740cf1f887d977af8f33 /libavcodec/mpeg4videodec.c
parent01fc5d6609e31539684785295d6c10b84d70b215 (diff)
mpeg4: support frame parameter changes with frame-mt
Adds a flag context_reinit to MpegEncContext to relieable keep track of frame parameter changes which require a context reinitialization. This is required for broken inputs which change the frame size but error out before the context can be reinitialized.
Diffstat (limited to 'libavcodec/mpeg4videodec.c')
-rw-r--r--libavcodec/mpeg4videodec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 27cae9f846..4a4998cdaa 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -1600,6 +1600,9 @@ static int decode_vol_header(MpegEncContext *s, GetBitContext *gb){
height = get_bits(gb, 13);
skip_bits1(gb); /* marker */
if(width && height && !(s->width && s->codec_tag == AV_RL32("MP4S"))){ /* they should be non zero but who knows ... */
+ if (s->width && s->height &&
+ (s->width != width || s->height != height))
+ s->context_reinit = 1;
s->width = width;
s->height = height;
}