aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-01 15:25:42 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-01 15:25:42 +0100
commit0f4c03cd634031181479ca94874e1b80b5638417 (patch)
tree88e950e6349699090f698deea8e6da1b6279605c
parent2d1d053c5d2ca59c8c0f35d91404cd899267add1 (diff)
parent0989a120f1dec400c54fcb54670cb84bba36d99b (diff)
downloadffmpeg-0f4c03cd634031181479ca94874e1b80b5638417.tar.gz
Merge commit '0989a120f1dec400c54fcb54670cb84bba36d99b' into release/2.2
* commit '0989a120f1dec400c54fcb54670cb84bba36d99b': mpeg12: Always invoke the get_format() callback Conflicts: libavcodec/mpeg12dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mpeg12dec.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index a464556aea..fcb5011b24 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1206,6 +1206,16 @@ static const enum AVPixelFormat mpeg2_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 inline int uses_vdpau(AVCodecContext *avctx) {
return avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG1 || avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG2;
}
@@ -1214,16 +1224,18 @@ 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 (s->chroma_format < 2)
- return ff_thread_get_format(avctx,
- avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO ?
+ pix_fmts = avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO ?
mpeg1_hwaccel_pixfmt_list_420 :
- mpeg2_hwaccel_pixfmt_list_420);
+ mpeg2_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_thread_get_format(avctx, pix_fmts);
}
static void setup_hwaccel_for_pixfmt(AVCodecContext *avctx)