From: <thi...@ke...> - 2011-01-26 22:37:39
|
Module: gst-plugins-bad Branch: master Commit: 6395b4590886cf8d02d7198f8c4968c19a137848 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=6395b4590886cf8d02d7198f8c4968c19a137848 Author: Thiago Santos <thi...@co...> Date: Tue Jan 25 18:10:18 2011 -0300 camerabin2: Handle videosink states more carefully When going to ready, camerabin2 could create an empty file if the videosink was put to ready. This patch only puts videosink to ready on the PAUSED_TO_READY state change if it is on PAUSED or PLAYING. --- gst/camerabin2/gstcamerabin2.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index 8b82c7f..22d37e9 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -630,8 +630,10 @@ gst_camera_bin_change_state (GstElement * element, GstStateChange trans) switch (trans) { case GST_STATE_CHANGE_PAUSED_TO_READY: + if (GST_STATE (camera->videosink) >= GST_STATE_PAUSED) + gst_element_set_state (camera->videosink, GST_STATE_READY); + gst_tag_setter_reset_tags (GST_TAG_SETTER (camera)); - gst_element_set_state (camera->videosink, GST_STATE_READY); break; case GST_STATE_CHANGE_READY_TO_NULL: gst_element_set_state (camera->videosink, GST_STATE_NULL); |