From d7a27613c1f4b77ea82a430a091fd4f8102bedbc Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 13 Jul 2011 16:56:21 +0100 Subject: [PATCH] v4l2: stop streaming in READY and NULL --- sys/v4l2/gstv4l2sink.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c index c8681d0004..3ba2fbc74d 100644 --- a/sys/v4l2/gstv4l2sink.c +++ b/sys/v4l2/gstv4l2sink.c @@ -517,16 +517,13 @@ gst_v4l2sink_change_state (GstElement * element, GstStateChange transition) switch (transition) { case GST_STATE_CHANGE_PAUSED_TO_READY: -#if 0 - if (v4l2sink->state == STATE_STREAMING) { - if (!gst_v4l2_object_stop_streaming (v4l2sink->v4l2object)) { - return GST_STATE_CHANGE_FAILURE; - } - v4l2sink->state = STATE_PENDING_STREAMON; - } -#endif + if (!gst_v4l2_object_stop (v4l2sink->v4l2object)) + return GST_STATE_CHANGE_FAILURE; break; case GST_STATE_CHANGE_READY_TO_NULL: + /* we need to call stop here too */ + if (!gst_v4l2_object_stop (v4l2sink->v4l2object)) + return GST_STATE_CHANGE_FAILURE; /* close the device */ if (!gst_v4l2_object_close (v4l2sink->v4l2object)) return GST_STATE_CHANGE_FAILURE;