* commit '1f29e5d7a2b0950f3b6820896e97e2c02e6a10a9': h263dec: call get_format after setting resolution and profile
Unified · Split
| @@ -43,6 +43,14 @@ · 42 unmodified lines | ||
| 43 | 43 | #include "vdpau_internal.h" |
| 44 | 44 | #include "thread.h" |
| 45 | 45 | |
| 46 | +static enum AVPixelFormat h263_get_format(AVCodecContext *avctx) | |
| 47 | +{ | |
| 48 | + if (avctx->codec->id == AV_CODEC_ID_MSS2) | |
| 49 | + return AV_PIX_FMT_YUV420P; | |
| 50 | + | |
| 51 | + return avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts); | |
| 52 | +} | |
| 53 | + | |
| 46 | 54 | av_cold int ff_h263_decode_init(AVCodecContext *avctx) |
| 47 | 55 | { |
| 48 | 56 | MpegEncContext *s = avctx->priv_data; |
| @@ -57,10 +65,6 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) · 8 unmodified lines | ||
| 57 | 65 | s->quant_precision = 5; |
| 58 | 66 | s->decode_mb = ff_h263_decode_mb; |
| 59 | 67 | s->low_delay = 1; |
| 60 | − if (avctx->codec->id == AV_CODEC_ID_MSS2) | |
| 61 | − avctx->pix_fmt = AV_PIX_FMT_YUV420P; | |
| 62 | − else | |
| 63 | − avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts); | |
| 64 | 68 | s->unrestricted_mv = 1; |
| 65 | 69 | |
| 66 | 70 | /* select sub codec */ |
| @@ -120,6 +124,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) · 53 unmodified lines | ||
| 120 | 124 | if (avctx->codec->id != AV_CODEC_ID_H263 && |
| 121 | 125 | avctx->codec->id != AV_CODEC_ID_H263P && |
| 122 | 126 | avctx->codec->id != AV_CODEC_ID_MPEG4) { |
| 127 | + avctx->pix_fmt = h263_get_format(avctx); | |
| 123 | 128 | ff_mpv_idct_init(s); |
| 124 | 129 | if ((ret = ff_mpv_common_init(s)) < 0) |
| 125 | 130 | return ret; |
| @@ -505,9 +510,11 @@ retry: · 379 unmodified lines | ||
| 505 | 510 | return ret; |
| 506 | 511 | } |
| 507 | 512 | |
| 508 | − if (!s->context_initialized) | |
| 513 | + if (!s->context_initialized) { | |
| 514 | + avctx->pix_fmt = h263_get_format(avctx); | |
| 509 | 515 | if ((ret = ff_mpv_common_init(s)) < 0) |
| 510 | 516 | return ret; |
| 517 | + } | |
| 511 | 518 | |
| 512 | 519 | if (!s->current_picture_ptr || s->current_picture_ptr->f->data[0]) { |
| 513 | 520 | int i = ff_find_unused_picture(s, 0); |