examples/seek: Don't unpause on clock-lost unless playing
authorJan Schmidt <thaytan@noraisin.net>
Wed, 4 Aug 2010 11:44:22 +0000 (21:44 +1000)
committerJan Schmidt <thaytan@noraisin.net>
Wed, 4 Aug 2010 11:46:56 +0000 (21:46 +1000)
If the pipeline is paused by the user, don't pause/unpause
on clock-lost.

tests/examples/seek/seek.c

index 1d6bdca..8c231cd 100644 (file)
@@ -2402,9 +2402,10 @@ static void
 msg_clock_lost (GstBus * bus, GstMessage * message, GstPipeline * data)
 {
   g_print ("clock lost! PAUSE and PLAY to select a new clock\n");
-
-  gst_element_set_state (pipeline, GST_STATE_PAUSED);
-  gst_element_set_state (pipeline, GST_STATE_PLAYING);
+  if (state == GST_STATE_PLAYING) {
+    gst_element_set_state (pipeline, GST_STATE_PAUSED);
+    gst_element_set_state (pipeline, GST_STATE_PLAYING);
+  }
 }
 
 #ifdef HAVE_X