mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
playbin2: Ignore async state changes of the uridecodebins
Otherwise the async state change from READY->PAUSED of the uridecodebins will take playbin2 from PLAYING->PAUSED again during gapless group switches. Fixes bug #602000.
This commit is contained in:
parent
3362bf2778
commit
ea40d8e36a
1 changed files with 21 additions and 8 deletions
|
@ -2112,13 +2112,28 @@ gst_play_bin_handle_message (GstBin * bin, GstMessage * msg)
|
||||||
msg = NULL;
|
msg = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ASYNC_START ||
|
||||||
|
GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ASYNC_DONE) {
|
||||||
|
GstObject *src = GST_OBJECT_CAST (msg->src);
|
||||||
|
|
||||||
|
/* Ignore async state changes from the uridecodebin children,
|
||||||
|
* see bug #602000. */
|
||||||
|
group = playbin->curr_group;
|
||||||
|
if (src && (group = playbin->curr_group) &&
|
||||||
|
((group->uridecodebin && src == GST_OBJECT_CAST (group->uridecodebin))
|
||||||
|
|| (group->suburidecodebin
|
||||||
|
&& src == GST_OBJECT_CAST (group->suburidecodebin)))) {
|
||||||
|
GST_DEBUG_OBJECT (playbin,
|
||||||
|
"Ignoring async state change of uridecodebin: %s",
|
||||||
|
GST_OBJECT_NAME (src));
|
||||||
|
gst_message_unref (msg);
|
||||||
|
msg = NULL;
|
||||||
|
}
|
||||||
} else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR) {
|
} else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR) {
|
||||||
/* If we get an error of the subtitle uridecodebin transform
|
/* If we get an error of the subtitle uridecodebin transform
|
||||||
* them into warnings and disable the subtitles */
|
* them into warnings and disable the subtitles */
|
||||||
group = playbin->curr_group;
|
group = playbin->curr_group;
|
||||||
if (group && group->suburidecodebin) {
|
if (group && group->suburidecodebin) {
|
||||||
|
|
||||||
GstObject *srcparent = gst_object_get_parent (GST_OBJECT_CAST (msg->src));
|
|
||||||
if (G_UNLIKELY (gst_object_has_ancestor (msg->src, GST_OBJECT_CAST
|
if (G_UNLIKELY (gst_object_has_ancestor (msg->src, GST_OBJECT_CAST
|
||||||
(group->suburidecodebin)))) {
|
(group->suburidecodebin)))) {
|
||||||
GError *err;
|
GError *err;
|
||||||
|
@ -2176,9 +2191,6 @@ gst_play_bin_handle_message (GstBin * bin, GstMessage * msg)
|
||||||
no_more_pads_cb (NULL, group);
|
no_more_pads_cb (NULL, group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (srcparent)
|
|
||||||
gst_object_unref (srcparent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3224,13 +3236,14 @@ setup_next_source (GstPlayBin * playbin, GstState target)
|
||||||
old_group->valid = FALSE;
|
old_group->valid = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* swap old and new */
|
||||||
|
playbin->curr_group = new_group;
|
||||||
|
playbin->next_group = old_group;
|
||||||
|
|
||||||
/* activate the new group */
|
/* activate the new group */
|
||||||
if (!activate_group (playbin, new_group, target))
|
if (!activate_group (playbin, new_group, target))
|
||||||
goto activate_failed;
|
goto activate_failed;
|
||||||
|
|
||||||
/* swap old and new */
|
|
||||||
playbin->curr_group = new_group;
|
|
||||||
playbin->next_group = old_group;
|
|
||||||
GST_PLAY_BIN_UNLOCK (playbin);
|
GST_PLAY_BIN_UNLOCK (playbin);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue