diff options
author | Janne Grunau <janne-libav@jannau.net> | 2012-09-18 15:48:14 +0200 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2012-09-19 19:58:15 +0200 |
commit | 8701f4f8e8a7aa71c39f0917472d22bf6a1f0f43 (patch) | |
tree | 8f8ba7cfff9d11c2754e740cf1f887d977af8f33 /libavcodec/mpegvideo.c | |
parent | 01fc5d6609e31539684785295d6c10b84d70b215 (diff) | |
download | ffmpeg-8701f4f8e8a7aa71c39f0917472d22bf6a1f0f43.tar.gz |
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/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index f9f5c5263f..50331356fe 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -550,6 +550,15 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, ff_MPV_common_init(s); } + if (s->height != s1->height || s->width != s1->width || s->context_reinit) { + int err; + s->context_reinit = 0; + s->height = s1->height; + s->width = s1->width; + if ((err = ff_MPV_common_frame_size_change(s)) < 0) + return err; + } + s->avctx->coded_height = s1->avctx->coded_height; s->avctx->coded_width = s1->avctx->coded_width; s->avctx->width = s1->avctx->width; |