mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
streamsynchronizer: Should wait state change complete before start another state change
Should wait state change complete before start another state change. Can't ensure can received async-done message when state change from PLAYING to PAUSED. https://bugzilla.gnome.org/show_bug.cgi?id=736655
This commit is contained in:
parent
7ce97c723c
commit
1942870257
1 changed files with 8 additions and 8 deletions
|
@ -101,22 +101,22 @@ run_streamsynchronizer_handle_eos (const gchar * launch_line)
|
|||
fail_unless_equals_int (GST_MESSAGE_TYPE (msg), GST_MESSAGE_ASYNC_DONE);
|
||||
gst_message_unref (msg);
|
||||
|
||||
fail_unless_equals_int (gst_element_get_state (pipeline, NULL, NULL, -1),
|
||||
GST_STATE_CHANGE_SUCCESS);
|
||||
fail_unless_equals_int (gst_element_get_state (pipeline, NULL, NULL,
|
||||
GST_CLOCK_TIME_NONE), GST_STATE_CHANGE_SUCCESS);
|
||||
|
||||
fail_unless (gst_element_set_state (pipeline, GST_STATE_PAUSED) !=
|
||||
GST_STATE_CHANGE_FAILURE);
|
||||
|
||||
/* wait for preroll */
|
||||
msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
||||
GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR);
|
||||
|
||||
fail_unless_equals_int (GST_MESSAGE_TYPE (msg), GST_MESSAGE_ASYNC_DONE);
|
||||
gst_message_unref (msg);
|
||||
/* can't ensure can received async-done message when call state change very quickly. */
|
||||
fail_unless_equals_int (gst_element_get_state (pipeline, NULL, NULL,
|
||||
GST_CLOCK_TIME_NONE), GST_STATE_CHANGE_SUCCESS);
|
||||
|
||||
fail_unless (gst_element_set_state (pipeline, GST_STATE_PLAYING) !=
|
||||
GST_STATE_CHANGE_FAILURE);
|
||||
|
||||
fail_unless_equals_int (gst_element_get_state (pipeline, NULL, NULL,
|
||||
GST_CLOCK_TIME_NONE), GST_STATE_CHANGE_SUCCESS);
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||
|
||||
gst_object_unref (bus);
|
||||
|
|
Loading…
Reference in a new issue