summaryrefslogtreecommitdiff
path: root/libavcodec/qsvdec.c
diff options
context:
space:
mode:
authorChen,Wenbin <wenbin.chen@intel.com>2021-03-12 10:44:06 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2022-01-12 10:02:24 +0800
commite6b990e25d2b2f443faca10accc91e1e9b998e5a (patch)
treeb488c4f6ab14277b9b3acdd54ed19bbbdebfbdaa /libavcodec/qsvdec.c
parentb697326a68372bec6dc3adece9afaaaebae5028d (diff)
downloadffmpeg-e6b990e25d2b2f443faca10accc91e1e9b998e5a.tar.gz
libavcodec/qsvdec.c: using queue count to unref frame
MSDK vc1 and av1 sometimes output frame into the same suface, but ffmpeg-qsv assume the surface will be used only once, so it will unref the frame when it receives the output surface. Now change it to unref frame according to queue count. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Diffstat (limited to 'libavcodec/qsvdec.c')
-rw-r--r--libavcodec/qsvdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 08370c8a0b..d9e0fef1f1 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -570,7 +570,7 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q,
return AVERROR_BUG;
}
- out_frame->queued = 1;
+ out_frame->queued += 1;
av_fifo_generic_write(q->async_fifo, &out_frame, sizeof(out_frame), NULL);
av_fifo_generic_write(q->async_fifo, &sync, sizeof(sync), NULL);
} else {
@@ -583,7 +583,7 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q,
av_fifo_generic_read(q->async_fifo, &out_frame, sizeof(out_frame), NULL);
av_fifo_generic_read(q->async_fifo, &sync, sizeof(sync), NULL);
- out_frame->queued = 0;
+ out_frame->queued -= 1;
if (avctx->pix_fmt != AV_PIX_FMT_QSV) {
do {