-launch: handle clock-lost messages

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.
This commit is contained in:
Wim Taymans 2009-04-10 14:15:36 +02:00
parent 376bed78ce
commit cf78781c6b

View 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")); g_print ("New clock: %s\n", (clock ? GST_OBJECT_NAME (clock) : "NULL"));
break; 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: case GST_MESSAGE_EOS:
waiting_eos = FALSE; waiting_eos = FALSE;
g_print (_ g_print (_