[rygel] renderer-gst: Fix two criticals on startup



commit 42760e42807025badc36ad5a40db017ceb647f31
Author: Jens Georg <mail jensge org>
Date:   Sat Mar 15 10:06:56 2014 +0100

    renderer-gst: Fix two criticals on startup
    
    Signed-off-by: Jens Georg <mail jensge org>

 .../rygel-playbin-player.vala                      |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/librygel-renderer-gst/rygel-playbin-player.vala 
b/src/librygel-renderer-gst/rygel-playbin-player.vala
index 9e8408b..0bfb912 100644
--- a/src/librygel-renderer-gst/rygel-playbin-player.vala
+++ b/src/librygel-renderer-gst/rygel-playbin-player.vala
@@ -293,7 +293,8 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer {
         get {
             int64 dur=0;
 
-            if (this.playbin.source.query_duration (Format.TIME, out dur)) {
+            if (this.playbin.source != null &&
+                this.playbin.source.query_duration (Format.TIME, out dur)) {
                 return dur / Gst.USECOND;
             } else {
                 return 0;
@@ -303,9 +304,10 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer {
 
     public int64 size {
         get {
-            int64 dur;
+            int64 dur = 0;
 
-            if (this.playbin.source.query_duration (Format.BYTES, out dur)) {
+            if (this.playbin.source != null &&
+                this.playbin.source.query_duration (Format.BYTES, out dur)) {
                 return dur;
             } else {
                 return 0;


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