validate: Wait for the PAUSED state to be reached before executing actions

This commit is contained in:
Thibault Saunier 2014-05-02 20:05:28 +02:00
parent bb42d287e7
commit aceba228ce

View file

@ -846,11 +846,12 @@ message_cb (GstBus * bus, GstMessage * message, GstValidateScenario * scenario)
case GST_MESSAGE_STATE_CHANGED: case GST_MESSAGE_STATE_CHANGED:
{ {
if (GST_MESSAGE_SRC (message) == GST_OBJECT (scenario->pipeline)) { if (GST_MESSAGE_SRC (message) == GST_OBJECT (scenario->pipeline)) {
GstState nstate; GstState nstate, pstate;
gst_message_parse_state_changed (message, gst_message_parse_state_changed (message,
NULL, &nstate, NULL); &pstate, &nstate, NULL);
_add_get_position_source (scenario); if (pstate == GST_STATE_READY && nstate == GST_STATE_PAUSED)
_add_get_position_source (scenario);
} }
break; break;
} }