}
}
-int ff_qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt)
+static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt)
{
mfxVideoParam param = { { 0 } };
mfxBitstream bs = { { { 0 } } };
{
QSVFrame *cur;
- MFXVideoDECODE_Close(q->session);
+ if (q->session)
+ MFXVideoDECODE_Close(q->session);
cur = q->work_frames;
while (cur) {
int flush = !avpkt->size || q->reinit_pending;
if (!q->engine_ready) {
- ret = ff_qsv_decode_init(avctx, q, avpkt);
+ ret = qsv_decode_init(avctx, q, avpkt);
if (ret)
return ret;
}