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.
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 */
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 */