summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2019-02-11 16:49:32 +0800
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-02-24 19:13:57 +0000
commit6287016a747d0ee9b94420e11d4aa31e4e355f2e (patch)
treed683fa3cc1ea903836f7b8ec38574121a819cc95
parentfffb3f628d8451e83635505218d7d442562c3acb (diff)
msdkdec: release the occupied surface for MFX_WRN_DEVICE_BUSY
When MFXVideoDECODE_DecodeFrameAsync () returns MFX_WRN_DEVICE_BUSY with an output surface, a new input surface is required when retrying MFXVideoDECODE_DecodeFrameAsync (). This fixes the out-of-surface issue mentioned in https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/890
-rw-r--r--sys/msdk/gstmsdkdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/msdk/gstmsdkdec.c b/sys/msdk/gstmsdkdec.c
index 134459fab..024aae44a 100644
--- a/sys/msdk/gstmsdkdec.c
+++ b/sys/msdk/gstmsdkdec.c
@@ -1041,6 +1041,12 @@ gst_msdkdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
/* If device is busy, wait 1ms and retry, as per MSDK's recomendation */
g_usleep (1000);
+ if (task->surface &&
+ task->surface == surface->surface && !task->sync_point) {
+ free_surface (thiz, surface);
+ surface = NULL;
+ }
+
/* If the current surface is still busy, we should do sync oepration
* then tries to decode again
*/