summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-09-27 03:38:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-09-27 03:38:48 +0200
commitbe5dd8aa5558cabe256c78de0ec8063f5810b96f (patch)
treef11ab629c1a914261b6e0438d2b8375d8c30d906
parent28b1698a7cccded1df32a543321fd24af928e06c (diff)
parent4e03b2097ca59843ed65424a572b7acd5345f088 (diff)
Merge commit '4e03b2097ca59843ed65424a572b7acd5345f088'
* commit '4e03b2097ca59843ed65424a572b7acd5345f088': 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 ed3490b1ba..95cc1a8693 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1209,6 +1209,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;
}
@@ -1217,16 +1227,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)