rygel r289 - in trunk/src: media-providers/tracker media-server



Author: zeeshanak
Date: Tue Nov 18 21:00:10 2008
New Revision: 289
URL: http://svn.gnome.org/viewvc/rygel?rev=289&view=rev

Log:
Vala syntax update:

- structs need to be initialized now.
- struct fields don't need to be initialized to null anymore.
- initialize all variables before using them.

Modified:
   trunk/src/media-providers/tracker/rygel-tracker-item.vala
   trunk/src/media-server/rygel-media-item.vala
   trunk/src/media-server/rygel-media-server.vala
   trunk/src/media-server/rygel-metadata-extractor.vala

Modified: trunk/src/media-providers/tracker/rygel-tracker-item.vala
==============================================================================
--- trunk/src/media-providers/tracker/rygel-tracker-item.vala	(original)
+++ trunk/src/media-providers/tracker/rygel-tracker-item.vala	Tue Nov 18 21:00:10 2008
@@ -49,7 +49,7 @@
         string date;
 
         if (seconds != "") {
-            TimeVal tv;
+            TimeVal tv = TimeVal ();
 
             tv.tv_sec = seconds.to_int ();
             tv.tv_usec = 0;

Modified: trunk/src/media-server/rygel-media-item.vala
==============================================================================
--- trunk/src/media-server/rygel-media-item.vala	(original)
+++ trunk/src/media-server/rygel-media-item.vala	Tue Nov 18 21:00:10 2008
@@ -108,7 +108,7 @@
         }
 
         /* Add resource data */
-        DIDLLiteResource res;
+        DIDLLiteResource res = DIDLLiteResource ();
 
         res.reset ();
 
@@ -125,12 +125,6 @@
 
         didl_writer.add_res (res);
 
-        /* FIXME: These lines should be remove once GB#526552 is fixed */
-        res.uri = null;
-        res.protocol = null;
-        res.mime_type = null;
-        res.dlna_profile = null;
-
         /* End of item */
         didl_writer.end_item ();
     }

Modified: trunk/src/media-server/rygel-media-server.vala
==============================================================================
--- trunk/src/media-server/rygel-media-server.vala	(original)
+++ trunk/src/media-server/rygel-media-server.vala	Tue Nov 18 21:00:10 2008
@@ -136,7 +136,7 @@
          * We do this so that we can host the modified file, and also to
          * make sure the generated UDN stays the same between sessions. */
         FileStream f = FileStream.open (desc_path, "w+");
-        int res;
+        int res = -1;
 
         if (f != null)
             res = Xml.Doc.dump (f, doc);

Modified: trunk/src/media-server/rygel-metadata-extractor.vala
==============================================================================
--- trunk/src/media-server/rygel-metadata-extractor.vala	(original)
+++ trunk/src/media-server/rygel-metadata-extractor.vala	Tue Nov 18 21:00:10 2008
@@ -42,7 +42,7 @@
     /* Signals */
     public signal void metadata_available (string uri,
                                            string key,
-                                           ref GLib.Value value);
+                                           ref Gst.Value value);
     public signal void extraction_done (string uri);
 
     /* Properties */
@@ -147,7 +147,7 @@
 
     /* Fetch value of each tag in the @tag_list and signal it's availability */
     private void foreach_tag (TagList tag_list, string tag) {
-        GLib.Value value;
+        Gst.Value value = Gst.Value ();
 
         if (tag_list.copy_value (out value, tag_list, tag)) {
             this.metadata_available (this.playbin.uri, tag, ref value);
@@ -186,7 +186,7 @@
         weak string content_type = file_info.get_content_type ();
         weak string mime = g_content_type_get_mime_type (content_type);
         if (mime != null) {
-            GLib.Value value;
+            Gst.Value value = Gst.Value ();
 
             value.init (typeof (string));
             value.set_string (mime);
@@ -201,7 +201,7 @@
 
         Format format = Format.TIME;
         if (this.playbin.query_duration (ref format, out duration)) {
-            GLib.Value duration_val;
+            Gst.Value duration_val = Gst.Value ();
 
             duration_val.init (typeof (int64));
             duration_val.set_int64 (duration);
@@ -268,7 +268,7 @@
         int val;
 
         if (structure.get_int (key, out val)) {
-            GLib.Value value;
+            Gst.Value value = Gst.Value ();
 
             value.init (typeof (int));
             value.set_int (val);



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