v4l2bufferpool: Check corruption flag on the right buffer
authorAleix Conchillo FlaquƩ <aleix@oblong.com>
Thu, 26 Feb 2015 00:45:11 +0000 (16:45 -0800)
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Thu, 26 Feb 2015 01:53:19 +0000 (20:53 -0500)
We where checking the buffer we are copying to instead of the buffer we
are copying from.

https://bugzilla.gnome.org/show_bug.cgi?id=740040

sys/v4l2/gstv4l2bufferpool.c

index 543ce91..1cb902d 100644 (file)
@@ -1715,9 +1715,12 @@ gst_v4l2_buffer_pool_process (GstV4l2BufferPool * pool, GstBuffer ** buf)
 
           /* An empty buffer on capture indicates the end of stream */
           if (gst_buffer_get_size (tmp) == 0) {
+            gboolean corrupted = GST_BUFFER_FLAG_IS_SET (tmp,
+                GST_BUFFER_FLAG_CORRUPTED);
+
             gst_v4l2_buffer_pool_release_buffer (bpool, tmp);
 
-            if (GST_BUFFER_FLAG_IS_SET (*buf, GST_BUFFER_FLAG_CORRUPTED))
+            if (corrupted)
               goto buffer_corrupted;
             else
               goto eos;