mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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.
This commit is contained in:
parent
3da135ce02
commit
6395b45908
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue