diff options
author | Wim Taymans <wtaymans@redhat.com> | 2014-04-21 15:35:32 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2014-04-21 15:40:33 +0200 |
commit | 1c5c49a94ccf180295e7d40bbbdc9fe28ace291f (patch) | |
tree | 021e9082875ddaedc9667d514827066dd2cd67c6 | |
parent | c268eab145726eba73f052fe4b190892197c48fa (diff) |
play: Improve pipeline states
First set the pipeline to the PAUSED state to check if we are dealing
with a live pipeline or not. Then move to the desired state.
If we don't do this, it is possible that we receive a BUFFERING message
before we know that the pipeline is live and we would set the pipeline
to PAUSED and deadlock.
-rw-r--r-- | tools/gst-play.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/gst-play.c b/tools/gst-play.c index c3e0167f5..b2afb5dc9 100644 --- a/tools/gst-play.c +++ b/tools/gst-play.c @@ -396,7 +396,7 @@ play_uri (GstPlay * play, const gchar * next_uri) g_object_set (play->playbin, "uri", next_uri, NULL); - sret = gst_element_set_state (play->playbin, play->desired_state); + sret = gst_element_set_state (play->playbin, GST_STATE_PAUSED); switch (sret) { case GST_STATE_CHANGE_FAILURE: /* ignore, we should get an error message posted on the bus */ @@ -411,6 +411,8 @@ play_uri (GstPlay * play, const gchar * next_uri) default: break; } + if (play->desired_state != GST_STATE_PAUSED) + sret = gst_element_set_state (play->playbin, play->desired_state); } /* returns FALSE if we have reached the end of the playlist */ |