summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Grzeschik <m.grzeschik@pengutronix.de>2010-06-23 11:47:43 +0200
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-07-06 11:03:39 +0100
commit34c7cabe2c674a7739e471468e6380f95ba2f426 (patch)
treedffd73fc92cde76c47aecf25a174fe1dfd87880d
parent8aed3176ce65a1963d1b2bea8b9ed110714ca4e2 (diff)
v4l2sink: destroy buffer pool when changing state to NULL
In the case we change the State from READY_TO_NULL the buffers in the pool still hold an open dup file descriptor to the device, therefore the device release function will not be called and the device will probably answer with -EBUSY when we reopen it in the next NULL_TO_READY transition. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> See bug #622500 and #612244.
-rw-r--r--sys/v4l2/gstv4l2sink.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
index 64cdadcaa..679f7e290 100644
--- a/sys/v4l2/gstv4l2sink.c
+++ b/sys/v4l2/gstv4l2sink.c
@@ -461,6 +461,8 @@ gst_v4l2sink_change_state (GstElement * element, GstStateChange transition)
}
break;
case GST_STATE_CHANGE_READY_TO_NULL:
+ gst_v4l2_buffer_pool_destroy (v4l2sink->pool);
+ v4l2sink->pool = NULL;
/* close the device */
if (!gst_v4l2_object_stop (v4l2sink->v4l2object))
return GST_STATE_CHANGE_FAILURE;