mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-27 00:16:37 +00:00
media-info: fix playback tests
They weren't waiting for the pipeline to properly change state before sending seek events, that would cause some events to return TRUE even if they were not handled
This commit is contained in:
parent
387f7c1b63
commit
36e5c626af
1 changed files with 25 additions and 5 deletions
|
@ -499,6 +499,7 @@ check_playback_scenario (GstValidateMediaInfo * mi,
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstMessage *msg;
|
GstMessage *msg;
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
|
GstStateChangeReturn state_ret;
|
||||||
|
|
||||||
playbin = gst_element_factory_make ("playbin", "fc-playbin");
|
playbin = gst_element_factory_make ("playbin", "fc-playbin");
|
||||||
videosink = gst_element_factory_make ("fakesink", "fc-videosink");
|
videosink = gst_element_factory_make ("fakesink", "fc-videosink");
|
||||||
|
@ -515,15 +516,28 @@ check_playback_scenario (GstValidateMediaInfo * mi,
|
||||||
g_object_set (playbin, "video-sink", videosink, "audio-sink", audiosink,
|
g_object_set (playbin, "video-sink", videosink, "audio-sink", audiosink,
|
||||||
"uri", mi->uri, NULL);
|
"uri", mi->uri, NULL);
|
||||||
|
|
||||||
if (gst_element_set_state (playbin,
|
bus = gst_pipeline_get_bus (GST_PIPELINE (playbin));
|
||||||
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) {
|
|
||||||
|
state_ret = gst_element_set_state (playbin, GST_STATE_PAUSED);
|
||||||
|
if (state_ret == GST_STATE_CHANGE_FAILURE) {
|
||||||
#if 0
|
#if 0
|
||||||
GST_VALIDATE_REPORT (fc, GST_VALIDATE_ISSUE_ID_FILE_PLAYBACK_START_FAILURE,
|
GST_VALIDATE_REPORT (fc, GST_VALIDATE_ISSUE_ID_FILE_PLAYBACK_START_FAILURE,
|
||||||
"Failed to " "change pipeline state to playing");
|
"Failed to " "change pipeline state to playing");
|
||||||
#endif
|
#endif
|
||||||
*error_message = g_strdup ("Failed to change pipeline to playing");
|
*error_message = g_strdup ("Failed to change pipeline to paused");
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
goto end;
|
goto end;
|
||||||
|
} else if (state_ret == GST_STATE_CHANGE_ASYNC) {
|
||||||
|
msg =
|
||||||
|
gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
||||||
|
GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_EOS | GST_MESSAGE_ERROR);
|
||||||
|
if (msg && GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ASYNC_DONE) {
|
||||||
|
gst_message_unref (msg);
|
||||||
|
} else {
|
||||||
|
ret = FALSE;
|
||||||
|
*error_message = g_strdup ("Playback finihshed unexpectedly");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (configure_function) {
|
if (configure_function) {
|
||||||
|
@ -531,7 +545,13 @@ check_playback_scenario (GstValidateMediaInfo * mi,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bus = gst_pipeline_get_bus (GST_PIPELINE (playbin));
|
if (gst_element_set_state (playbin,
|
||||||
|
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) {
|
||||||
|
*error_message = g_strdup ("Failed to set pipeline to playing");
|
||||||
|
ret = FALSE;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
msg =
|
msg =
|
||||||
gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
||||||
GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
|
GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
|
||||||
|
@ -567,9 +587,9 @@ check_playback_scenario (GstValidateMediaInfo * mi,
|
||||||
"File playback finished unexpectedly", messages_prefix);
|
"File playback finished unexpectedly", messages_prefix);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
gst_object_unref (bus);
|
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
gst_object_unref (bus);
|
||||||
gst_element_set_state (playbin, GST_STATE_NULL);
|
gst_element_set_state (playbin, GST_STATE_NULL);
|
||||||
gst_object_unref (playbin);
|
gst_object_unref (playbin);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue