mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
playbin3: Re-enable buffering message handling
Buffering messages are only sent for the active group (in case there is more than one). If the inactive group posts buffering messages we keep the last one around and will post it once it becomes the playing one.
This commit is contained in:
parent
ec7d81f67c
commit
eacb7a77d2
1 changed files with 14 additions and 15 deletions
|
@ -2431,6 +2431,7 @@ gst_play_bin3_handle_message (GstBin * bin, GstMessage * msg)
|
||||||
GstSourceGroup *group = NULL, *other_group = NULL;
|
GstSourceGroup *group = NULL, *other_group = NULL;
|
||||||
gboolean changed = FALSE;
|
gboolean changed = FALSE;
|
||||||
guint group_id;
|
guint group_id;
|
||||||
|
GstMessage *buffering_msg;
|
||||||
|
|
||||||
if (!gst_message_parse_group_id (msg, &group_id)) {
|
if (!gst_message_parse_group_id (msg, &group_id)) {
|
||||||
GST_ERROR_OBJECT (bin,
|
GST_ERROR_OBJECT (bin,
|
||||||
|
@ -2465,30 +2466,30 @@ gst_play_bin3_handle_message (GstBin * bin, GstMessage * msg)
|
||||||
if (group->playing == FALSE)
|
if (group->playing == FALSE)
|
||||||
changed = TRUE;
|
changed = TRUE;
|
||||||
group->playing = TRUE;
|
group->playing = TRUE;
|
||||||
|
buffering_msg = group->pending_buffering_msg;
|
||||||
|
group->pending_buffering_msg = NULL;
|
||||||
GST_SOURCE_GROUP_UNLOCK (group);
|
GST_SOURCE_GROUP_UNLOCK (group);
|
||||||
|
|
||||||
GST_SOURCE_GROUP_LOCK (other_group);
|
GST_SOURCE_GROUP_LOCK (other_group);
|
||||||
other_group->playing = FALSE;
|
other_group->playing = FALSE;
|
||||||
GST_SOURCE_GROUP_UNLOCK (other_group);
|
GST_SOURCE_GROUP_UNLOCK (other_group);
|
||||||
|
|
||||||
debug_groups (playbin);
|
debug_groups (playbin);
|
||||||
GST_PLAY_BIN3_UNLOCK (playbin);
|
GST_PLAY_BIN3_UNLOCK (playbin);
|
||||||
if (changed)
|
if (changed)
|
||||||
gst_play_bin3_check_group_status (playbin);
|
gst_play_bin3_check_group_status (playbin);
|
||||||
else
|
else
|
||||||
GST_DEBUG_OBJECT (bin, "Groups didn't changed");
|
GST_DEBUG_OBJECT (bin, "Groups didn't changed");
|
||||||
}
|
/* If there was a pending buffering message to send, do it now */
|
||||||
#if 0
|
if (buffering_msg)
|
||||||
else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_BUFFERING) {
|
GST_BIN_CLASS (parent_class)->handle_message (bin, buffering_msg);
|
||||||
GstSourceGroup *group = playbin->curr_group;
|
} else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_BUFFERING) {
|
||||||
gboolean pending;
|
GstSourceGroup *group;
|
||||||
|
|
||||||
/* drop buffering messages from child queues while we are switching
|
|
||||||
* groups (because the application set a new uri in about-to-finish)
|
|
||||||
* if the playsink queue still has buffers to play */
|
|
||||||
|
|
||||||
|
/* Only post buffering messages for group which is currently playing */
|
||||||
|
group = find_source_group_owner (playbin, msg->src);
|
||||||
GST_SOURCE_GROUP_LOCK (group);
|
GST_SOURCE_GROUP_LOCK (group);
|
||||||
pending = group->stream_changed_pending;
|
if (!group->playing) {
|
||||||
|
|
||||||
if (pending) {
|
|
||||||
GST_DEBUG_OBJECT (playbin, "Storing buffering message from pending group "
|
GST_DEBUG_OBJECT (playbin, "Storing buffering message from pending group "
|
||||||
"%p %" GST_PTR_FORMAT, group, msg);
|
"%p %" GST_PTR_FORMAT, group, msg);
|
||||||
gst_message_replace (&group->pending_buffering_msg, msg);
|
gst_message_replace (&group->pending_buffering_msg, msg);
|
||||||
|
@ -2496,9 +2497,7 @@ gst_play_bin3_handle_message (GstBin * bin, GstMessage * msg)
|
||||||
msg = NULL;
|
msg = NULL;
|
||||||
}
|
}
|
||||||
GST_SOURCE_GROUP_UNLOCK (group);
|
GST_SOURCE_GROUP_UNLOCK (group);
|
||||||
}
|
} else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_STREAM_COLLECTION) {
|
||||||
#endif
|
|
||||||
if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_STREAM_COLLECTION) {
|
|
||||||
GstStreamCollection *collection = NULL;
|
GstStreamCollection *collection = NULL;
|
||||||
|
|
||||||
gst_message_parse_stream_collection (msg, &collection);
|
gst_message_parse_stream_collection (msg, &collection);
|
||||||
|
|
Loading…
Reference in a new issue