mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-27 11:32:51 +00:00
v4l2: free all queued buffers
Don't just loop over the first num_queued buffers but loop over all the buffers and check if they need to be freed. It is possible that not all buffers are queued and then the entry in our array will be NULL. Those buffers that are not queued were freed in stop(). Fixes https://bugzilla.gnome.org/show_bug.cgi?id=696651
This commit is contained in:
parent
0dfc88d893
commit
14300e5805
1 changed files with 3 additions and 2 deletions
|
@ -524,8 +524,9 @@ gst_v4l2_buffer_pool_stop (GstBufferPool * bpool)
|
|||
ret = GST_BUFFER_POOL_CLASS (parent_class)->stop (bpool);
|
||||
|
||||
/* then free the remaining buffers */
|
||||
for (n = 0; n < pool->num_queued; n++) {
|
||||
gst_v4l2_buffer_pool_free_buffer (bpool, pool->buffers[n]);
|
||||
for (n = 0; n < pool->num_buffers; n++) {
|
||||
if (pool->buffers[n])
|
||||
gst_v4l2_buffer_pool_free_buffer (bpool, pool->buffers[n]);
|
||||
}
|
||||
pool->num_queued = 0;
|
||||
g_free (pool->buffers);
|
||||
|
|
Loading…
Reference in a new issue