mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-29 07:12:36 +00:00
launch: don't exit the loop on buffering in paused
When we receive a buffering message of 100% in the paused state, we exit the event_loop and move to the PLAYING state. What should happen is that we wait for both ASYNC-DONE and 100% buffering before continueing.
This commit is contained in:
parent
31fbc86e09
commit
9baef63f5b
1 changed files with 11 additions and 10 deletions
|
@ -493,6 +493,7 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
|
||||||
GstMessage *message = NULL;
|
GstMessage *message = NULL;
|
||||||
EventLoopResult res = ELR_NO_ERROR;
|
EventLoopResult res = ELR_NO_ERROR;
|
||||||
gboolean buffering = FALSE;
|
gboolean buffering = FALSE;
|
||||||
|
gboolean prerolled = target_state != GST_STATE_PAUSED;
|
||||||
|
|
||||||
bus = gst_element_get_bus (GST_ELEMENT (pipeline));
|
bus = gst_element_get_bus (GST_ELEMENT (pipeline));
|
||||||
|
|
||||||
|
@ -665,19 +666,19 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
|
||||||
if (GST_MESSAGE_SRC (message) != GST_OBJECT_CAST (pipeline))
|
if (GST_MESSAGE_SRC (message) != GST_OBJECT_CAST (pipeline))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* ignore when we are buffering since then we mess with the states
|
|
||||||
* ourselves. */
|
|
||||||
if (buffering) {
|
|
||||||
PRINT (_("Prerolled, waiting for buffering to finish...\n"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
gst_message_parse_state_changed (message, &old, &new, &pending);
|
gst_message_parse_state_changed (message, &old, &new, &pending);
|
||||||
|
|
||||||
/* if we reached the final target state, exit */
|
/* if we reached the final target state, exit */
|
||||||
if (target_state == GST_STATE_PAUSED && new == target_state)
|
if (target_state == GST_STATE_PAUSED && new == target_state) {
|
||||||
|
prerolled = TRUE;
|
||||||
|
/* ignore when we are buffering since then we mess with the states
|
||||||
|
* ourselves. */
|
||||||
|
if (buffering) {
|
||||||
|
PRINT (_("Prerolled, waiting for buffering to finish...\n"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
goto exit;
|
goto exit;
|
||||||
|
}
|
||||||
/* else not an interesting message */
|
/* else not an interesting message */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -698,7 +699,7 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
|
||||||
if (target_state == GST_STATE_PLAYING) {
|
if (target_state == GST_STATE_PLAYING) {
|
||||||
PRINT (_("Done buffering, setting pipeline to PLAYING ...\n"));
|
PRINT (_("Done buffering, setting pipeline to PLAYING ...\n"));
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
} else
|
} else if (prerolled)
|
||||||
goto exit;
|
goto exit;
|
||||||
} else {
|
} else {
|
||||||
/* buffering busy */
|
/* buffering busy */
|
||||||
|
|
Loading…
Reference in a new issue