Commit fffae8e6 authored by Ivan Uskov's avatar Ivan Uskov Committed by Michael Niedermayer

libavcodec/qsvdec.c: the ff_get_format() missed at refactoring has been restored

Reviewed-by: 's avatarHendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 9d1d7b36
...@@ -54,6 +54,9 @@ int ff_qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt) ...@@ -54,6 +54,9 @@ int ff_qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt)
mfxVideoParam param = { { 0 } }; mfxVideoParam param = { { 0 } };
mfxBitstream bs = { { { 0 } } }; mfxBitstream bs = { { { 0 } } };
int ret; int ret;
enum AVPixelFormat pix_fmts[3] = { AV_PIX_FMT_QSV,
AV_PIX_FMT_NV12,
AV_PIX_FMT_NONE };
q->iopattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY; q->iopattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
if (!q->session) { if (!q->session) {
...@@ -120,7 +123,11 @@ int ff_qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt) ...@@ -120,7 +123,11 @@ int ff_qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt)
return ff_qsv_error(ret); return ff_qsv_error(ret);
} }
avctx->pix_fmt = AV_PIX_FMT_NV12; ret = ff_get_format(avctx, pix_fmts);
if (ret < 0)
return ret;
avctx->pix_fmt = ret;
avctx->profile = param.mfx.CodecProfile; avctx->profile = param.mfx.CodecProfile;
avctx->level = param.mfx.CodecLevel; avctx->level = param.mfx.CodecLevel;
avctx->coded_width = param.mfx.FrameInfo.Width; avctx->coded_width = param.mfx.FrameInfo.Width;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment