aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRĂ©mi Denis-Courmont <remi@remlab.net>2014-09-25 11:59:58 +0300
committerLuca Barbato <lu_zero@gentoo.org>2014-09-27 15:49:06 +0200
commit0989a120f1dec400c54fcb54670cb84bba36d99b (patch)
tree68f22ab28e166e4baa1eeb3e9f9a65b270e1643c
parentc7caed88a03567e8777a606f4bd42f093c6b302c (diff)
downloadffmpeg-0989a120f1dec400c54fcb54670cb84bba36d99b.tar.gz
mpeg12: Always invoke the get_format() callback
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavcodec/mpeg12dec.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index cb713fdf50..0a5654a485 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1177,10 +1177,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
@@ -1190,11 +1201,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
#endif /* FF_API_XVMC */
if (s->chroma_format < 2)
- return avctx->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 avctx->get_format(avctx, pix_fmts);
}
/* Call this function when we know all parameters.