renderer-gst: Return null in error case
authorJens Georg <mail@jensge.org>
Sun, 23 Feb 2014 16:27:51 +0000 (17:27 +0100)
committerJens Georg <mail@jensge.org>
Sun, 23 Feb 2014 16:29:22 +0000 (17:29 +0100)
This is slightly bad since this is a constructor; we can safely return here
because the C code has not executed the constructor yet.

As the function was deprecated anyway with an earlier commit, beaty doesn't
really matter.

Signed-off-by: Jens Georg <mail@jensge.org>
https://bugzilla.gnome.org/show_bug.cgi?id=722021

src/librygel-renderer-gst/rygel-playbin-player.vala

index 72d2baa..1c0bd1d 100644 (file)
@@ -344,8 +344,7 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer {
 
     [Deprecated (since="0.21.5")]
     public Player.wrap (Gst.Element playbin) {
-        return_if_fail (playbin != null);
-        return_if_fail (playbin.get_type ().name() == "GstPlayBin");
+        return_val_if_fail (playbin.get_type ().name() == "GstPlayBin", null);
 
         this.playbin = playbin;
         this.setup_playbin ();