[rygel] media-export: Better checks for nullability



commit 66074b33471890bb5860a6095dd416ab7416872d
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Jul 21 21:45:32 2010 +0300

    media-export: Better checks for nullability
    
    - Only allow nullables to be declared as such.
    - Entertain videos without any audio part.

 .../media-export/rygel-media-export-item.vala      |   40 ++++++++++---------
 1 files changed, 21 insertions(+), 19 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-item.vala b/src/plugins/media-export/rygel-media-export-item.vala
index 1f3f65f..9ee379c 100644
--- a/src/plugins/media-export/rygel-media-export-item.vala
+++ b/src/plugins/media-export/rygel-media-export-item.vala
@@ -90,7 +90,7 @@ public class Rygel.MediaExport.Item : Rygel.MediaItem {
                         string                      id,
                         File                        file,
                         GUPnP.DLNAInformation       dlna_info,
-                        Gst.StreamVideoInformation? video,
+                        Gst.StreamVideoInformation  video,
                         Gst.StreamAudioInformation? audio,
                         string                      mime,
                         uint64                      size,
@@ -115,18 +115,20 @@ public class Rygel.MediaExport.Item : Rygel.MediaItem {
             this.bitrate = (int) tmp / 8;
         }
 
-        this.n_audio_channels = (int) audio.channels;
-        this.sample_freq = (int) audio.sample_rate;
+        if (audio != null) {
+            this.n_audio_channels = (int) audio.channels;
+            this.sample_freq = (int) audio.sample_rate;
+        }
     }
 
-    private Item.photo (MediaContainer              parent,
-                        string                      id,
-                        File                        file,
-                        GUPnP.DLNAInformation       dlna_info,
-                        Gst.StreamVideoInformation? video,
-                        string                      mime,
-                        uint64                      size,
-                        uint64                      mtime) {
+    private Item.photo (MediaContainer             parent,
+                        string                     id,
+                        File                       file,
+                        GUPnP.DLNAInformation      dlna_info,
+                        Gst.StreamVideoInformation video,
+                        string                     mime,
+                        uint64                     size,
+                        uint64                     mtime) {
         this (parent,
               id,
               file,
@@ -141,14 +143,14 @@ public class Rygel.MediaExport.Item : Rygel.MediaItem {
         this.color_depth = (int) video.depth;
     }
 
-    private Item.audio (MediaContainer              parent,
-                        string                      id,
-                        File                        file,
-                        GUPnP.DLNAInformation       dlna_info,
-                        Gst.StreamAudioInformation? audio,
-                        string                      mime,
-                        uint64                      size,
-                        uint64                      mtime) {
+    private Item.audio (MediaContainer             parent,
+                        string                     id,
+                        File                       file,
+                        GUPnP.DLNAInformation      dlna_info,
+                        Gst.StreamAudioInformation audio,
+                        string                     mime,
+                        uint64                     size,
+                        uint64                     mtime) {
         this (parent,
               id,
               file,



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