diff options
author | RĂ©mi Denis-Courmont <remi@remlab.net> | 2014-09-25 11:59:58 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-09-26 21:28:37 +0200 |
commit | 4e03b2097ca59843ed65424a572b7acd5345f088 (patch) | |
tree | d932b3180958d09e6ea5cb879c82ac07500e841f /libavcodec/mpeg12dec.c | |
parent | ce42316321145c435029dc288c2b5f1d48519dde (diff) | |
download | ffmpeg-4e03b2097ca59843ed65424a572b7acd5345f088.tar.gz |
mpeg12: Always invoke the get_format() callback
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/mpeg12dec.c')
-rw-r--r-- | libavcodec/mpeg12dec.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index e3bd1675a8..93e3900ce3 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1181,10 +1181,21 @@ static const enum AVPixelFormat mpeg12_hwaccel_pixfmt_list_420[] = { AV_PIX_FMT_NONE }; +static const enum AVPixelFormat mpeg12_pixfmt_list_422[] = { + AV_PIX_FMT_YUV422P, + AV_PIX_FMT_NONE +}; + +static const enum AVPixelFormat mpeg12_pixfmt_list_444[] = { + AV_PIX_FMT_YUV444P, + AV_PIX_FMT_NONE +}; + static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx) { Mpeg1Context *s1 = avctx->priv_data; MpegEncContext *s = &s1->mpeg_enc_ctx; + const enum AVPixelFormat *pix_fmts; #if FF_API_XVMC FF_DISABLE_DEPRECATION_WARNINGS @@ -1194,11 +1205,13 @@ FF_ENABLE_DEPRECATION_WARNINGS #endif /* FF_API_XVMC */ if (s->chroma_format < 2) - return ff_get_format(avctx, mpeg12_hwaccel_pixfmt_list_420); + pix_fmts = mpeg12_hwaccel_pixfmt_list_420; else if (s->chroma_format == 2) - return AV_PIX_FMT_YUV422P; + pix_fmts = mpeg12_pixfmt_list_422; else - return AV_PIX_FMT_YUV444P; + pix_fmts = mpeg12_pixfmt_list_444; + + return ff_get_format(avctx, pix_fmts); } /* Call this function when we know all parameters. |