validate: Connect to the bus signals watch as the main watch might already be connected
authorThibault Saunier <thibault.saunier@collabora.com>
Thu, 15 Aug 2013 10:18:56 +0000 (12:18 +0200)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Thu, 22 Aug 2013 15:01:44 +0000 (12:01 -0300)
validate/gst/validate/gst-validate.c

index b298b7daac7aeacb6bbf25afcd7c75fda2208a7a..92454500f3bd8a425fd388194ea0d96239f22ac7 100644 (file)
@@ -37,6 +37,7 @@ static gboolean
 bus_callback (GstBus * bus, GstMessage * message, gpointer data)
 {
   GMainLoop *loop = data;
+
   switch (GST_MESSAGE_TYPE (message)) {
     case GST_MESSAGE_ERROR:
     {
@@ -140,7 +141,8 @@ main (int argc, gchar ** argv)
   }
 
   bus = gst_element_get_bus (pipeline);
-  gst_bus_add_watch (bus, bus_callback, mainloop);
+  gst_bus_add_signal_watch (bus);
+  g_signal_connect (bus, "message", (GCallback) bus_callback, mainloop);
   gst_object_unref (bus);
 
   g_print ("Starting pipeline\n");