rygel r108 - in trunk: . src



Author: zeeshanak
Date: Tue Oct 28 21:00:32 2008
New Revision: 108
URL: http://svn.gnome.org/viewvc/rygel?rev=108&view=rev

Log:
Refactor: A separate function for extraction of 'duration'.

Modified:
   trunk/ChangeLog
   trunk/src/gupnp-metadata-extractor.vala

Modified: trunk/src/gupnp-metadata-extractor.vala
==============================================================================
--- trunk/src/gupnp-metadata-extractor.vala	(original)
+++ trunk/src/gupnp-metadata-extractor.vala	Tue Oct 28 21:00:32 2008
@@ -112,20 +112,7 @@
 
         message.parse_state_changed (out old_state, out new_state, null);
         if (new_state == State.PAUSED && old_state == State.READY) {
-            int64 duration;
-
-            Format format = Format.TIME;
-            if (this.playbin.query_duration (ref format, out duration)) {
-                GLib.Value duration_val;
-
-                duration_val.init (typeof (int64));
-                duration_val.set_int64 (duration);
-
-                /* signal the availability of duration tag */
-                this.metadata_available (this.playbin.uri,
-                                    TAG_DURATION,
-                                    ref duration_val);
-            }
+            this.extract_duration ();
 
             /* No hopes of getting any tags after this point */
             this.playbin.set_state (State.NULL);
@@ -133,6 +120,23 @@
         }
     }
 
+    private void extract_duration () {
+        int64 duration;
+
+        Format format = Format.TIME;
+        if (this.playbin.query_duration (ref format, out duration)) {
+            GLib.Value duration_val;
+
+            duration_val.init (typeof (int64));
+            duration_val.set_int64 (duration);
+
+            /* signal the availability of duration tag */
+            this.metadata_available (this.playbin.uri,
+                    TAG_DURATION,
+                    ref duration_val);
+        }
+    }
+
     private void error_cb (Gst.Bus     bus,
                            Gst.Message message) {
 



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