v4l2bufferpool: do not stop a stream not previously started
authorJulien Isorce <julien.isorce@collabora.co.uk>
Wed, 8 Jan 2014 16:51:21 +0000 (16:51 +0000)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 10 Jan 2014 22:20:21 +0000 (17:20 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=720568

sys/v4l2/gstv4l2bufferpool.c

index 58fc2f39484cf85bc3b581c2553c40946584570a..121a5782b6daeef9c91c8b9d07d90bb852da619a 100644 (file)
@@ -672,6 +672,13 @@ stop_streaming (GstV4l2BufferPool * pool)
 
   gst_poll_set_flushing (obj->poll, TRUE);
 
+  if (!pool->streaming) {
+    /* it avoid error: STREAMOFF 22 (Invalid argument) when
+     * attempting to stop a stream not previously started */
+    GST_DEBUG_OBJECT (pool, "no need to stop, was not previously started");
+    return TRUE;
+  }
+
   switch (obj->mode) {
     case GST_V4L2_IO_RW:
       break;