mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-08 15:32:32 +00:00
play: Update buffering state for live pipelines
Update the buffering variable, even for live pipelines so that we don't print \n for each buffering message.
This commit is contained in:
parent
9398207101
commit
c268eab145
1 changed files with 5 additions and 6 deletions
|
@ -217,20 +217,19 @@ play_bus_msg (GstBus * bus, GstMessage * msg, gpointer user_data)
|
||||||
gst_message_parse_buffering (msg, &percent);
|
gst_message_parse_buffering (msg, &percent);
|
||||||
g_print ("%s %d%% \r", _("Buffering..."), percent);
|
g_print ("%s %d%% \r", _("Buffering..."), percent);
|
||||||
|
|
||||||
/* no state management needed for live pipelines */
|
|
||||||
if (play->is_live)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (percent == 100) {
|
if (percent == 100) {
|
||||||
/* a 100% message means buffering is done */
|
/* a 100% message means buffering is done */
|
||||||
if (play->buffering) {
|
if (play->buffering) {
|
||||||
play->buffering = FALSE;
|
play->buffering = FALSE;
|
||||||
gst_element_set_state (play->playbin, play->desired_state);
|
/* no state management needed for live pipelines */
|
||||||
|
if (!play->is_live)
|
||||||
|
gst_element_set_state (play->playbin, play->desired_state);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* buffering... */
|
/* buffering... */
|
||||||
if (!play->buffering) {
|
if (!play->buffering) {
|
||||||
gst_element_set_state (play->playbin, GST_STATE_PAUSED);
|
if (!play->is_live)
|
||||||
|
gst_element_set_state (play->playbin, GST_STATE_PAUSED);
|
||||||
play->buffering = TRUE;
|
play->buffering = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue