v4l2: free the queued buffers

Only free the queued buffers that we keep track of in our buffer array. for rw
io-mode, we do allocate buffers but we don't keep track of them in the buffer
array.
This commit is contained in:
Wim Taymans 2012-04-23 16:51:28 +02:00
parent 5d7d4e0d9b
commit 713ddbf541

View file

@ -458,9 +458,8 @@ 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_allocated; n++) {
if (pool->buffers[n])
gst_v4l2_buffer_pool_free_buffer (bpool, pool->buffers[n]);
for (n = 0; n < pool->num_queued; n++) {
gst_v4l2_buffer_pool_free_buffer (bpool, pool->buffers[n]);
}
g_free (pool->buffers);
pool->buffers = NULL;