v4l2: fix flushing start and stop

Move the flushing calls to the right place in the bufferpool.
Fix the min and max buffer sizes.
This commit is contained in:
Wim Taymans 2011-07-25 15:38:38 +02:00
parent 0a88ac4c92
commit e6a8718f0c
2 changed files with 6 additions and 4 deletions

View file

@ -240,8 +240,8 @@ gst_v4l2_buffer_pool_set_config (GstBufferPool * bpool, GstStructure * config)
GST_DEBUG_OBJECT (pool, "config %" GST_PTR_FORMAT, config);
pool->size = size;
pool->min_buffers = min_buffers;
pool->max_buffers = max_buffers;
pool->max_buffers = MAX (min_buffers, max_buffers);
pool->min_buffers = MIN (pool->max_buffers, min_buffers);
pool->prefix = prefix;
pool->align = align;
@ -360,6 +360,8 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool)
if (!start_streaming (pool))
goto start_failed;
gst_poll_set_flushing (obj->poll, FALSE);
return TRUE;
/* ERRORS */
@ -398,6 +400,8 @@ gst_v4l2_buffer_pool_stop (GstBufferPool * bpool)
GST_DEBUG_OBJECT (pool, "stopping pool");
gst_poll_set_flushing (obj->poll, TRUE);
if (pool->streaming) {
switch (obj->mode) {
case GST_V4L2_IO_RW:

View file

@ -2418,8 +2418,6 @@ gst_v4l2_object_stop (GstV4l2Object * v4l2object)
if (!GST_V4L2_IS_ACTIVE (v4l2object))
goto done;
gst_poll_set_flushing (v4l2object->poll, TRUE);
if (v4l2object->pool) {
GST_DEBUG_OBJECT (v4l2object->element, "deactivating pool");
gst_buffer_pool_set_active (v4l2object->pool, FALSE);