gst-discoverer: Print out topology if available.
authorEdward Hervey <bilboed@bilboed.com>
Wed, 29 Sep 2010 16:57:50 +0000 (18:57 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Wed, 29 Sep 2010 17:00:38 +0000 (19:00 +0200)
If we have some unhandled streams, we can still print out the remaining
topology.

tools/gst-discoverer.c

index 0dbca30..d547f0d 100644 (file)
@@ -251,12 +251,6 @@ print_info (GstDiscovererInfo * info, GError * err)
   switch (result) {
     case GST_DISCOVERER_OK:
     {
-      sinfo = gst_discoverer_info_get_stream_info (info);
-      g_print ("\nTopology:\n");
-      print_topology (sinfo, 1);
-      g_print ("\nDuration:\n");
-      print_duration (info, 1);
-      gst_discoverer_stream_info_unref (sinfo);
       break;
     }
     case GST_DISCOVERER_URI_INVALID:
@@ -293,6 +287,14 @@ print_info (GstDiscovererInfo * info, GError * err)
     }
   }
 
+  if ((sinfo = gst_discoverer_info_get_stream_info (info))) {
+    g_print ("\nTopology:\n");
+    print_topology (sinfo, 1);
+    g_print ("\nDuration:\n");
+    print_duration (info, 1);
+    gst_discoverer_stream_info_unref (sinfo);
+  }
+
   g_print ("\n");
 }