Some reordering to match the tutorial's explanations.

This commit is contained in:
Xavi Artigas 2012-06-11 12:12:31 +02:00
parent 9cbd722bbe
commit 12e5e2b7e8

View file

@ -28,11 +28,6 @@ static void cb_message (GstBus *bus, GstMessage *msg, CustomData *data) {
gst_element_set_state (data->pipeline, GST_STATE_READY); gst_element_set_state (data->pipeline, GST_STATE_READY);
g_main_loop_quit (data->loop); g_main_loop_quit (data->loop);
break; break;
case GST_MESSAGE_CLOCK_LOST:
/* Get a new clock */
gst_element_set_state (data->pipeline, GST_STATE_PAUSED);
gst_element_set_state (data->pipeline, GST_STATE_PLAYING);
break;
case GST_MESSAGE_BUFFERING: { case GST_MESSAGE_BUFFERING: {
gint percent = 0; gint percent = 0;
@ -48,6 +43,11 @@ static void cb_message (GstBus *bus, GstMessage *msg, CustomData *data) {
gst_element_set_state (data->pipeline, GST_STATE_PLAYING); gst_element_set_state (data->pipeline, GST_STATE_PLAYING);
break; break;
} }
case GST_MESSAGE_CLOCK_LOST:
/* Get a new clock */
gst_element_set_state (data->pipeline, GST_STATE_PAUSED);
gst_element_set_state (data->pipeline, GST_STATE_PLAYING);
break;
default: default:
/* Unhandled message */ /* Unhandled message */
break; break;