v4l2: request 0 buffers when stopping

Without this stopping the pool in *_set_caps() is useless.
S_FMT will still fail with EBUSY.

https://bugzilla.gnome.org/show_bug.cgi?id=699835
This commit is contained in:
Michael Olbrich 2013-05-06 16:54:02 +02:00 committed by Sebastian Dröge
parent 8ca4a47cdc
commit 113b60935a

View file

@ -582,6 +582,19 @@ gst_v4l2_buffer_pool_stop (GstBufferPool * bpool)
g_free (pool->buffers); g_free (pool->buffers);
pool->buffers = NULL; pool->buffers = NULL;
if (pool->num_buffers > 0) {
struct v4l2_requestbuffers breq;
memset (&breq, 0, sizeof (struct v4l2_requestbuffers));
breq.type = obj->type;
breq.count = 0;
breq.memory = V4L2_MEMORY_MMAP;
if (v4l2_ioctl (pool->video_fd, VIDIOC_REQBUFS, &breq) < 0) {
GST_ERROR_OBJECT (pool, "error releasing buffers: %s",
g_strerror (errno));
}
pool->num_buffers = 0;
}
return ret; return ret;
/* ERRORS */ /* ERRORS */