core: Fix TagName != structure key
authorJens Georg <mail@jensge.org>
Sun, 24 May 2009 14:26:12 +0000 (16:26 +0200)
committerJens Georg <mail@jensge.org>
Thu, 25 Jun 2009 12:43:41 +0000 (14:43 +0200)
src/rygel/rygel-metadata-extractor.vala

index 3913078..868067f 100644 (file)
@@ -276,22 +276,24 @@ public class Rygel.MetadataExtractor: GLib.Object {
     }
 
     private void extract_audio_info (Structure structure) {
-        this.extract_int_value (structure, TAG_RYGEL_CHANNELS);
-        this.extract_int_value (structure, TAG_RYGEL_RATE);
+        this.extract_int_value (structure, "channels", TAG_RYGEL_CHANNELS);
+        this.extract_int_value (structure, "rate", TAG_RYGEL_RATE);
     }
 
     private void extract_video_info (Structure structure) {
-        this.extract_int_value (structure, TAG_RYGEL_WIDTH);
-        this.extract_int_value (structure, TAG_RYGEL_HEIGHT);
-        this.extract_int_value (structure, TAG_RYGEL_DEPTH);
+        this.extract_int_value (structure, "width", TAG_RYGEL_WIDTH);
+        this.extract_int_value (structure, "height", TAG_RYGEL_HEIGHT);
+        this.extract_int_value (structure, "depth", TAG_RYGEL_DEPTH);
     }
 
-    private void extract_int_value (Structure structure, string key) {
+    private void extract_int_value (Structure structure,
+                                    string key,
+                                    string tag) {
         int val;
 
         if (structure.get_int (key, out val)) {
             tag_list.add (TagMergeMode.REPLACE,
-                          key,
+                          tag,
                           val);
         }
     }