Commit 3d751d19 authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

playbin2: Make it possible for READY->PAUSED to succeed after it failed the first time

If READY->PAUSED failed in the source element we would've swapped
the current and next group already. To allow READY->PAUSED to succeed
after the first failure we have to swap the current and next group
back again. This also ensure that we're again in the same state
as before the failed state change and not at the next group.

This was especially a problem for playbin2 pipelines that use the
new mounting support in giosrc as the source would fail for READY->PAUSED
the first time, the application mounts the location and then tries
to go READY->PAUSED again (and this time it would succeed).

Fixes bug #588078.
parent 85151175
......@@ -2821,8 +2821,22 @@ gst_play_bin_change_state (GstElement * element, GstStateChange transition)
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
GstSourceGroup *curr_group;
curr_group = playbin->curr_group;
if (curr_group && curr_group->valid) {
/* unlink our pads with the sink */
deactivate_group (playbin, curr_group);
/* Swap current and next group back */
playbin->curr_group = playbin->next_group;
playbin->next_group = curr_group;
return ret;
switch (transition) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment