mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
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.
This commit is contained in:
parent
8515117573
commit
3d751d190d
1 changed files with 15 additions and 1 deletions
|
@ -2821,8 +2821,22 @@ gst_play_bin_change_state (GstElement * element, GstStateChange transition)
|
|||
}
|
||||
|
||||
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
||||
if (ret == GST_STATE_CHANGE_FAILURE)
|
||||
if (ret == GST_STATE_CHANGE_FAILURE) {
|
||||
if (transition == GST_STATE_CHANGE_READY_TO_PAUSED) {
|
||||
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) {
|
||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||
|
|
Loading…
Reference in a new issue