Uppon certain downstream error, stop() is called without a flush(). This mean that
the streaming thread may still be running even though unlock has been called.
Now calling flush to reset the decoder state if we are processing.
GST_DEBUG_OBJECT (self, "Stopping");
+ gst_v4l2_object_unlock (self->v4l2output);
+ gst_v4l2_object_unlock (self->v4l2capture);
+
+ GST_VIDEO_DECODER_STREAM_LOCK (decoder);
+ /* Wait for capture thread to stop */
+ gst_pad_stop_task (decoder->srcpad);
+ self->output_flow = GST_FLOW_OK;
+ GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
+
/* Should have been flushed already */
g_assert (g_atomic_int_get (&self->active) == FALSE);
g_assert (g_atomic_int_get (&self->processing) == FALSE);