-launch: handle clock-lost messages
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 10 Apr 2009 12:15:36 +0000 (14:15 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 10 Apr 2009 12:15:36 +0000 (14:15 +0200)
When we receive a clock-lost message, we need to select a new clock in the
pipeline by setting the pipeline to PAUSED and back to PLAYING.

tools/gst-launch.c

index ec38eb1..fceebf2 100644 (file)
@@ -438,6 +438,11 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
         g_print ("New clock: %s\n", (clock ? GST_OBJECT_NAME (clock) : "NULL"));
         break;
       }
+      case GST_MESSAGE_CLOCK_LOST:
+        g_print ("Clock lost, selecting a new one\n");
+        gst_element_set_state (pipeline, GST_STATE_PAUSED);
+        gst_element_set_state (pipeline, GST_STATE_PLAYING);
+        break;
       case GST_MESSAGE_EOS:
         waiting_eos = FALSE;
         g_print (_