diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2012-05-03 16:07:27 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-04-25 12:34:24 +0200 |
commit | 2e80c0d2c08d1fbda3286bfe397153ec65661322 (patch) | |
tree | d28f48ec01a687f4ffb8be2fe05842dc694d0190 /sys/v4l2/gstv4l2bufferpool.c | |
parent | 8f9cc96a69bf583aef07a77aea9f8570e86ef0f4 (diff) |
v4l2: bufferpool: reset buffer size in release_buffer
The buffer might still be in use elsewhere when dequeuing buffers for
outputs.
https://bugzilla.gnome.org/show_bug.cgi?id=698822
Diffstat (limited to 'sys/v4l2/gstv4l2bufferpool.c')
-rw-r--r-- | sys/v4l2/gstv4l2bufferpool.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index d4976fe08..f8851569d 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -683,8 +683,6 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer) /* this can change at every frame, esp. with jpeg */ if (obj->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) gst_buffer_resize (outbuf, 0, vbuffer.bytesused); - else - gst_buffer_resize (outbuf, 0, vbuffer.length); GST_BUFFER_TIMESTAMP (outbuf) = timestamp; @@ -897,6 +895,10 @@ gst_v4l2_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer) if (pool->buffers[index] == NULL) { GST_LOG_OBJECT (pool, "buffer %u not queued, putting on free list", index); + + /* reset to the full length, in case it was changed */ + gst_buffer_resize (buffer, 0, meta->vbuffer.length); + /* playback, put the buffer back in the queue to refill later. */ GST_BUFFER_POOL_CLASS (parent_class)->release_buffer (bpool, buffer); |