aboutsummaryrefslogtreecommitdiff
path: root/libavcodec/qsvdec.c
diff options
context:
space:
mode:
authorAnton Khirnov2017-01-07 21:06:16 +0100
committerAnton Khirnov2017-01-12 16:21:39 +0100
commitb68e353136db6f963212c457281d9716516cdc59 (patch)
tree2af4d7a54440fc0f9c4b98dcde0fc870ad0fd11d /libavcodec/qsvdec.c
parentac3c3ee678e51b05a2a7c30ce79465db46ba01fa (diff)
qsvdec: do not sync PIX_FMT_QSV surfaces
Introducing enforced sync points in arbitrary places is bad for performance. Since the vast majority of receiving code (QSV VPP or encoders, retrieving frames through hwcontext) will do the syncing, this change should not be visible to most callers. But bumping micro just in case. This is also consistent with what VAAPI hwaccel does.
Diffstat (limited to 'libavcodec/qsvdec.c')
-rw-r--r--libavcodec/qsvdec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index b83b0fcda8..0cbe5094c7 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -363,9 +363,11 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q,
av_fifo_generic_read(q->async_fifo, &sync, sizeof(sync), NULL);
out_frame->queued = 0;
- do {
- ret = MFXVideoCORE_SyncOperation(q->session, *sync, 1000);
- } while (ret == MFX_WRN_IN_EXECUTION);
+ if (avctx->pix_fmt != AV_PIX_FMT_QSV) {
+ do {
+ ret = MFXVideoCORE_SyncOperation(q->session, *sync, 1000);
+ } while (ret == MFX_WRN_IN_EXECUTION);
+ }
av_freep(&sync);