Workaround for driver need wait 2 seconds for CMD_STOP.
upstream status: imx specific
Signed-off-by: Song Bing <bing.song@nxp.com>
diff --git a/sys/v4l2/gstv4l2videodec.c b/sys/v4l2/gstv4l2videodec.c
index 6f7014e..8fd3ccc 100644
--- a/sys/v4l2/gstv4l2videodec.c
+++ b/sys/v4l2/gstv4l2videodec.c
@@ -386,6 +386,12 @@
if (gst_v4l2_decoder_cmd (self->v4l2output, V4L2_DEC_CMD_STOP, 0)) {
GstTask *task = decoder->srcpad->task;
+ // Workaround as CMD_STOP will wait long time.
+ if (gst_pad_get_task_state (decoder->srcpad) != GST_TASK_STARTED) {
+ GST_VIDEO_DECODER_STREAM_LOCK (decoder);
+ goto done;
+ }
+
/* If the decoder stop command succeeded, just wait until processing is
* finished */
GST_OBJECT_LOCK (task);