[rygel] renderer-gst: Use contract programming



commit dde6f868bc2002136cbfa54b7314c166c2738ead
Author: Jens Georg <mail jensge org>
Date:   Sun Feb 23 17:53:00 2014 +0100

    renderer-gst: Use contract programming
    
    Improve previous commit to be more valaish.
    
    Signed-off-by: Jens Georg <mail jensge org>

 .../rygel-playbin-player.vala                      |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/librygel-renderer-gst/rygel-playbin-player.vala 
b/src/librygel-renderer-gst/rygel-playbin-player.vala
index 1c0bd1d..9e8408b 100644
--- a/src/librygel-renderer-gst/rygel-playbin-player.vala
+++ b/src/librygel-renderer-gst/rygel-playbin-player.vala
@@ -343,9 +343,8 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer {
     }
 
     [Deprecated (since="0.21.5")]
-    public Player.wrap (Gst.Element playbin) {
-        return_val_if_fail (playbin.get_type ().name() == "GstPlayBin", null);
-
+    public Player.wrap (Gst.Element playbin)
+                        requires (playbin.get_type ().name () == "GstPlayBin") {
         this.playbin = playbin;
         this.setup_playbin ();
     }


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