gst-play: Handle CLOCK_LOST message
authorSebastian Dröge <sebastian@centricular.com>
Fri, 17 Jan 2014 14:10:42 +0000 (15:10 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 17 Jan 2014 14:13:15 +0000 (15:13 +0100)
It is necessary for playbin gapless playback when switching
between audio-only and video-only files for example.

tools/gst-play.c

index 6051cbbd00ca3ef80527c08edf216558c0aa6be0..ca3a0c8b0021c0f5364f88dbcfb6e7c7b4404a77 100644 (file)
@@ -210,6 +210,12 @@ play_bus_msg (GstBus * bus, GstMessage * msg, gpointer user_data)
       }
       break;
     }
+    case GST_MESSAGE_CLOCK_LOST:{
+      g_print (_("Clock lost, selecting a new one\n"));
+      gst_element_set_state (play->playbin, GST_STATE_PAUSED);
+      gst_element_set_state (play->playbin, GST_STATE_PLAYING);
+      break;
+    }
     case GST_MESSAGE_LATENCY:
       g_print ("Redistribute latency...\n");
       gst_bin_recalculate_latency (GST_BIN (play->playbin));