v4l2videodec: Handle start_streaming error
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 15 May 2014 14:44:29 +0000 (10:44 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 15 May 2014 16:22:04 +0000 (12:22 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=730207

sys/v4l2/gstv4l2videodec.c

index 4decd76..2867b7b 100644 (file)
@@ -528,8 +528,10 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
     GST_DEBUG_OBJECT (self, "Starting decoding thread");
 
     /* Enable processing input */
-    gst_v4l2_buffer_pool_start_streaming (GST_V4L2_BUFFER_POOL
-        (self->v4l2capture->pool));
+    if (!gst_v4l2_buffer_pool_start_streaming (GST_V4L2_BUFFER_POOL
+            (self->v4l2capture->pool)))
+      goto start_streaming_failed;
+
     gst_v4l2_object_unlock_stop (self->v4l2output);
     gst_v4l2_object_unlock_stop (self->v4l2capture);
 
@@ -566,6 +568,13 @@ not_negotiated:
     ret = GST_FLOW_NOT_NEGOTIATED;
     goto drop;
   }
+start_streaming_failed:
+  {
+    GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS,
+        (_("Failed to re-enabled decoder.")),
+        ("Could not re-enqueue and start streaming on decide."));
+    return GST_FLOW_ERROR;
+  }
 activate_failed:
   {
     GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS,