validate: Wait for the PAUSED state to be reached before executing actions
authorThibault Saunier <tsaunier@gnome.org>
Fri, 2 May 2014 18:05:28 +0000 (20:05 +0200)
committerThibault Saunier <tsaunier@gnome.org>
Fri, 2 May 2014 18:05:28 +0000 (20:05 +0200)
validate/gst/validate/gst-validate-scenario.c

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