v4l2: clear DISCONT flag when recycling buffers into the buffer pool
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 3 Mar 2012 13:04:48 +0000 (13:04 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 3 Mar 2012 13:07:45 +0000 (13:07 +0000)
The base class may have set the DISCONT flag on the first buffer pushed
out. We need to clear that when recycling buffers back into the buffer
pool, otherwise we constantly push out buffers with the discont flag
set, which might upset downstream elements, esp. for compressed
formats like mpeg-ts.

sys/v4l2/gstv4l2bufferpool.c

index 51419ff9849712876468ad56ab75421d46980276..a0b4c842aa10a930d88fbd856d6f66d1eb5ad55d 100644 (file)
@@ -98,6 +98,7 @@ gst_v4l2_buffer_finalize (GstV4l2Buffer * buffer)
     GST_LOG_OBJECT (pool->v4l2elem, "reviving buffer %p, %d", buffer, index);
     gst_buffer_ref (GST_BUFFER (buffer));
     GST_BUFFER_SIZE (buffer) = 0;
+    GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DISCONT);
     pool->buffers[index] = buffer;
   }