msdkdec: set decode_only for output only
authorHaihao Xiang <haihao.xiang@intel.com>
Mon, 11 Feb 2019 05:53:19 +0000 (13:53 +0800)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 12 Feb 2019 11:39:04 +0000 (11:39 +0000)
MSDK may return MFX_ERR_MORE_DATA but without output surface

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/887

sys/msdk/gstmsdkdec.c

index db58112..134459f 100644 (file)
@@ -1025,8 +1025,11 @@ gst_msdkdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
         break;
       }
     } else if (status == MFX_ERR_MORE_DATA) {
-      task->decode_only = TRUE;
-      thiz->next_task = (thiz->next_task + 1) % thiz->tasks->len;
+      if (task->surface) {
+        task->decode_only = TRUE;
+        thiz->next_task = (thiz->next_task + 1) % thiz->tasks->len;
+      }
+
       if (surface->surface->Data.Locked > 0)
         surface = NULL;
       flow = GST_VIDEO_DECODER_FLOW_NEED_DATA;