[rygel] renderer-gst: Return null in error case



commit 58c3ba92e714bc4d020d2362a51ca854ff3e3c80
Author: Jens Georg <mail jensge org>
Date:   Sun Feb 23 17:27:51 2014 +0100

    renderer-gst: Return null in error case
    
    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

 .../rygel-playbin-player.vala                      |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/librygel-renderer-gst/rygel-playbin-player.vala 
b/src/librygel-renderer-gst/rygel-playbin-player.vala
index 72d2baa..1c0bd1d 100644
--- a/src/librygel-renderer-gst/rygel-playbin-player.vala
+++ b/src/librygel-renderer-gst/rygel-playbin-player.vala
@@ -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 ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]