[rygel] core,plugins: MediaItem.size is now int64



commit a55f7089b183ab3dd956bc0e820429179f87d449
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Aug 9 20:27:50 2010 +0300

    core,plugins: MediaItem.size is now int64
    
    This is so that we can deal with resources bigger than 2GB.

 .../external/rygel-external-item-factory.vala      |    2 +-
 .../media-export/rygel-media-export-item.vala      |    4 ++--
 .../rygel-media-export-media-cache.vala            |    2 +-
 .../tracker/rygel-tracker-item-factory.vala        |    2 +-
 src/rygel/rygel-icon-info.vala                     |    8 ++++----
 src/rygel/rygel-live-response.vala                 |    4 ++--
 src/rygel/rygel-media-art-store.vala               |    2 +-
 src/rygel/rygel-media-item.vala                    |    8 ++++----
 src/rygel/rygel-seekable-response.vala             |    2 +-
 src/rygel/rygel-subtitle-manager.vala              |    2 +-
 src/rygel/rygel-subtitle.vala                      |    2 +-
 src/rygel/rygel-thumbnail.vala                     |    2 +-
 src/rygel/rygel-thumbnailer.vala                   |    2 +-
 13 files changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/src/plugins/external/rygel-external-item-factory.vala b/src/plugins/external/rygel-external-item-factory.vala
index 4d1edb7..3580c6e 100644
--- a/src/plugins/external/rygel-external-item-factory.vala
+++ b/src/plugins/external/rygel-external-item-factory.vala
@@ -78,7 +78,7 @@ public class Rygel.External.ItemFactory {
 
         value = props.lookup ("Size");
         if (value != null) {
-            item.size = value.get_int ();
+            item.size = value.get_int64 ();
         }
 
         value = props.lookup ("Artist");
diff --git a/src/plugins/media-export/rygel-media-export-item.vala b/src/plugins/media-export/rygel-media-export-item.vala
index d01425b..c982bef 100644
--- a/src/plugins/media-export/rygel-media-export-item.vala
+++ b/src/plugins/media-export/rygel-media-export-item.vala
@@ -51,7 +51,7 @@ public class Rygel.MediaExport.Item : Rygel.MediaItem {
 
         base (get_id (file), parent, title, upnp_class);
         this.mime_type = mime;
-        this.size = (long) size;
+        this.size = (int64) size;
         this.modified = mtime;
         this.add_uri (file.get_uri (), null);
     }
@@ -267,7 +267,7 @@ public class Rygel.MediaExport.Item : Rygel.MediaItem {
             this.date = tv.to_iso8601 ();
         }
 
-        this.size = (long) size;
+        this.size = (int64) size;
         this.modified = (int64) mtime;
 
         if (dlna_info.name != null) {
diff --git a/src/plugins/media-export/rygel-media-export-media-cache.vala b/src/plugins/media-export/rygel-media-export-media-cache.vala
index 747786d..934ae7e 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -537,7 +537,7 @@ public class Rygel.MediaExport.MediaCache : Object {
         item.mime_type = statement.column_text (DetailColumn.MIME_TYPE);
         item.duration = (long) statement.column_int64 (DetailColumn.DURATION);
 
-        item.size = (long) statement.column_int64 (DetailColumn.SIZE);
+        item.size = statement.column_int64 (DetailColumn.SIZE);
         item.bitrate = statement.column_int (DetailColumn.BITRATE);
 
         item.sample_freq = statement.column_int (DetailColumn.SAMPLE_FREQ);
diff --git a/src/plugins/tracker/rygel-tracker-item-factory.vala b/src/plugins/tracker/rygel-tracker-item-factory.vala
index 46761fd..59f97c2 100644
--- a/src/plugins/tracker/rygel-tracker-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-item-factory.vala
@@ -80,7 +80,7 @@ public abstract class Rygel.Tracker.ItemFactory {
             item.title = metadata[Metadata.FILE_NAME];
 
         if (metadata[Metadata.SIZE] != "")
-            item.size = metadata[Metadata.SIZE].to_int ();
+            item.size = metadata[Metadata.SIZE].to_int64 ();
 
         if (metadata[Metadata.DATE] != "")
             item.date = metadata[Metadata.DATE];
diff --git a/src/rygel/rygel-icon-info.vala b/src/rygel/rygel-icon-info.vala
index 556823b..f76aef1 100644
--- a/src/rygel/rygel-icon-info.vala
+++ b/src/rygel/rygel-icon-info.vala
@@ -29,10 +29,10 @@ public class Rygel.IconInfo {
     public string uri;
     public string file_extension;
 
-    public long size = -1;   // Size in bytes
-    public int width = -1;   // Width in pixels
-    public int height = -1;  // Height in pixels
-    public int depth = -1;   // depth of pixels in bytes
+    public int64 size = -1; // Size in bytes
+    public int width = -1;  // Width in pixels
+    public int height = -1; // Height in pixels
+    public int depth = -1;  // depth of pixels in bytes
 
     public IconInfo (string mime_type, string file_extension) {
         this.mime_type = mime_type;
diff --git a/src/rygel/rygel-live-response.vala b/src/rygel/rygel-live-response.vala
index b6ce55d..027d711 100644
--- a/src/rygel/rygel-live-response.vala
+++ b/src/rygel/rygel-live-response.vala
@@ -36,7 +36,7 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse {
 
     private HTTPSeek time_range;
 
-    private size_t buffered;
+    private int64 buffered;
     private bool out_of_sync;
 
     public LiveResponse (Soup.Server  server,
@@ -169,7 +169,7 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse {
                 return false;
             }
 
-            this.push_data (buffer.data, buffer.size);
+            this.push_data (buffer.data, (size_t) buffer.size);
             this.buffered++;
 
             if (this.buffered > MAX_BUFFERED_CHUNKS) {
diff --git a/src/rygel/rygel-media-art-store.vala b/src/rygel/rygel-media-art-store.vala
index 2471503..3350ccd 100644
--- a/src/rygel/rygel-media-art-store.vala
+++ b/src/rygel/rygel-media-art-store.vala
@@ -82,7 +82,7 @@ public class Rygel.MediaArtStore : GLib.Object {
 
         var thumb = new AlbumArt ();
         thumb.uri = file.get_uri ();
-        thumb.size = (long) info.get_size ();
+        thumb.size = (int64) info.get_size ();
 
         return thumb;
     }
diff --git a/src/rygel/rygel-media-item.vala b/src/rygel/rygel-media-item.vala
index b7d4075..0892432 100644
--- a/src/rygel/rygel-media-item.vala
+++ b/src/rygel/rygel-media-item.vala
@@ -47,9 +47,9 @@ public class Rygel.MediaItem : MediaObject {
     public string mime_type;
     public string dlna_profile;
 
-    public long size = -1;       // Size in bytes
-    public long duration = -1;   // Duration in seconds
-    public int bitrate = -1;     // Bytes/second
+    public int64 size = -1;     // Size in bytes
+    public long duration = -1;  // Duration in seconds
+    public int bitrate = -1;    // Bytes/second
 
     // Audio/Music
     public int sample_freq = -1;
@@ -220,7 +220,7 @@ public class Rygel.MediaItem : MediaObject {
             res.import_uri = import_uri;
         }
 
-        res.size = this.size;
+        res.size64 = this.size;
         res.duration = this.duration;
         res.bitrate = this.bitrate;
 
diff --git a/src/rygel/rygel-seekable-response.vala b/src/rygel/rygel-seekable-response.vala
index 6b6f750..befc48b 100644
--- a/src/rygel/rygel-seekable-response.vala
+++ b/src/rygel/rygel-seekable-response.vala
@@ -40,7 +40,7 @@ internal class Rygel.SeekableResponse : Rygel.HTTPResponse {
                              Soup.Message msg,
                              string       uri,
                              HTTPSeek     seek,
-                             size_t       file_length,
+                             int64        file_length,
                              Cancellable? cancellable) {
         var partial = seek.length < file_length;
 
diff --git a/src/rygel/rygel-subtitle-manager.vala b/src/rygel/rygel-subtitle-manager.vala
index cc7a41a..8ebe825 100644
--- a/src/rygel/rygel-subtitle-manager.vala
+++ b/src/rygel/rygel-subtitle-manager.vala
@@ -68,7 +68,7 @@ internal class Rygel.SubtitleManager : GLib.Object {
 
         var subtitle = new Subtitle ();
         subtitle.uri = srt_file.get_uri ();
-        subtitle.size = (long) info.get_attribute_uint64 (
+        subtitle.size = (int64) info.get_attribute_uint64 (
                                         FILE_ATTRIBUTE_STANDARD_SIZE);
 
         return subtitle;
diff --git a/src/rygel/rygel-subtitle.vala b/src/rygel/rygel-subtitle.vala
index 17d531f..0e4ff4f 100644
--- a/src/rygel/rygel-subtitle.vala
+++ b/src/rygel/rygel-subtitle.vala
@@ -32,7 +32,7 @@ public class Rygel.Subtitle {
     public string mime_type;
     public string caption_type;
 
-    public long size = -1;   // Size in bytes
+    public int64 size = -1;   // Size in bytes
 
     public Subtitle (string mime_type = "text/plain",
                      string caption_type = "srt") {
diff --git a/src/rygel/rygel-thumbnail.vala b/src/rygel/rygel-thumbnail.vala
index 15841e9..6c62f06 100644
--- a/src/rygel/rygel-thumbnail.vala
+++ b/src/rygel/rygel-thumbnail.vala
@@ -41,7 +41,7 @@ public class Rygel.Thumbnail : Rygel.IconInfo {
         var res = didl_item.add_resource ();
 
         res.uri = this.uri;
-        res.size = this.size;
+        res.size64 = this.size;
 
         res.width = this.width;
         res.height = this.height;
diff --git a/src/rygel/rygel-thumbnailer.vala b/src/rygel/rygel-thumbnailer.vala
index 7102dc0..90151be 100644
--- a/src/rygel/rygel-thumbnailer.vala
+++ b/src/rygel/rygel-thumbnailer.vala
@@ -111,7 +111,7 @@ internal class Rygel.Thumbnailer : GLib.Object {
         thumbnail.height = this.template.height;
         thumbnail.depth = this.template.depth;
         thumbnail.uri = Filename.to_uri (full_path, null);
-        thumbnail.size = (long) info.get_attribute_uint64 (
+        thumbnail.size = (int64) info.get_attribute_uint64 (
                                         FILE_ATTRIBUTE_STANDARD_SIZE);
 
         return thumbnail;



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