diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2012-05-03 16:07:27 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2013-09-13 16:29:45 +0200 |
commit | 3f31280ce6423a10f37a28f82860c7ebc72f0354 (patch) | |
tree | 9660fedd4251377010cbad766126125c7a976ab5 | |
parent | 03053d5b2d1e940f5499db1eb0e79d14e8c4bb0b (diff) | |
download | gst-plugins-good-3f31280ce6423a10f37a28f82860c7ebc72f0354.tar.gz gst-plugins-good-3f31280ce6423a10f37a28f82860c7ebc72f0354.tar.xz |
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
-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 62a8cfa93..9abcbd179 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -685,8 +685,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; @@ -899,6 +897,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); |