diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-13 22:12:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-13 22:13:04 +0200 |
commit | d3d265bae2b2f3d9a70329ffebb3ea04118512e7 (patch) | |
tree | e57f5d80f40493c0dc0fa92c695a94c41407b922 | |
parent | f87134c7a13f96f40160831e5b72e271e66a9730 (diff) | |
parent | 1f29e5d7a2b0950f3b6820896e97e2c02e6a10a9 (diff) | |
download | ffmpeg-d3d265bae2b2f3d9a70329ffebb3ea04118512e7.tar.gz |
Merge commit '1f29e5d7a2b0950f3b6820896e97e2c02e6a10a9'
* commit '1f29e5d7a2b0950f3b6820896e97e2c02e6a10a9':
h263dec: call get_format after setting resolution and profile
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h263dec.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 6a60fbabaf..c5e38fdd84 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -43,6 +43,14 @@ #include "vdpau_internal.h" #include "thread.h" +static enum AVPixelFormat h263_get_format(AVCodecContext *avctx) +{ + if (avctx->codec->id == AV_CODEC_ID_MSS2) + return AV_PIX_FMT_YUV420P; + + return avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts); +} + av_cold int ff_h263_decode_init(AVCodecContext *avctx) { MpegEncContext *s = avctx->priv_data; @@ -57,10 +65,6 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) s->quant_precision = 5; s->decode_mb = ff_h263_decode_mb; s->low_delay = 1; - if (avctx->codec->id == AV_CODEC_ID_MSS2) - avctx->pix_fmt = AV_PIX_FMT_YUV420P; - else - avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts); s->unrestricted_mv = 1; /* select sub codec */ @@ -120,6 +124,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) if (avctx->codec->id != AV_CODEC_ID_H263 && avctx->codec->id != AV_CODEC_ID_H263P && avctx->codec->id != AV_CODEC_ID_MPEG4) { + avctx->pix_fmt = h263_get_format(avctx); ff_mpv_idct_init(s); if ((ret = ff_mpv_common_init(s)) < 0) return ret; @@ -505,9 +510,11 @@ retry: return ret; } - if (!s->context_initialized) + if (!s->context_initialized) { + avctx->pix_fmt = h263_get_format(avctx); if ((ret = ff_mpv_common_init(s)) < 0) return ret; + } if (!s->current_picture_ptr || s->current_picture_ptr->f->data[0]) { int i = ff_find_unused_picture(s, 0); |