throw an error if elements fail to link.
authorZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Sun, 28 Dec 2008 16:48:03 +0000 (16:48 +0000)
committerZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Sun, 28 Dec 2008 16:48:03 +0000 (16:48 +0000)
svn path=/trunk/; revision=400

src/rygel/rygel-gst-stream.vala

index 187cc14..f33d1fd 100644 (file)
@@ -30,7 +30,8 @@ using Gee;
 using Gst;
 
 public errordomain Rygel.GstStreamError {
-    MISSING_PLUGIN
+    MISSING_PLUGIN,
+    LINK
 }
 
 public class Rygel.GstStream : Pipeline {
@@ -61,7 +62,11 @@ public class Rygel.GstStream : Pipeline {
         sink.handoff += this.on_new_buffer;
 
         this.add_many (src, sink);
-        src.link (sink);
+        if (!src.link (sink)) {
+            throw new GstStreamError.LINK ("Failed to link %s to %s",
+                                           src.name,
+                                           sink.name);
+        }
 
         // Bus handler
         var bus = this.get_bus ();