From: Jens Georg Date: Sat, 21 Jul 2012 13:49:09 +0000 (+0200) Subject: media-export: Work-around bgo#680366 X-Git-Tag: RYGEL_0_15_1~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=666a6d53faf2e0cdff77ae072d11cf48a3b9e1ba;p=profile%2Fivi%2Frygel.git media-export: Work-around bgo#680366 Conflicts: src/plugins/media-export/rygel-media-export-harvesting-task.vala --- diff --git a/src/plugins/media-export/rygel-media-export-harvester.vala b/src/plugins/media-export/rygel-media-export-harvester.vala index 1cf0dba..abf1e25 100644 --- a/src/plugins/media-export/rygel-media-export-harvester.vala +++ b/src/plugins/media-export/rygel-media-export-harvester.vala @@ -83,7 +83,7 @@ internal class Rygel.MediaExport.Harvester : GLib.Object { // Cancel a probably running harvester this.cancel (file); - var task = new HarvestingTask (this.extractor, + var task = new HarvestingTask (new MetadataExtractor (), this.monitor, this.file_filter, file, diff --git a/src/plugins/media-export/rygel-media-export-harvesting-task.vala b/src/plugins/media-export/rygel-media-export-harvesting-task.vala index 27a9dc1..dfa88b4 100644 --- a/src/plugins/media-export/rygel-media-export-harvesting-task.vala +++ b/src/plugins/media-export/rygel-media-export-harvesting-task.vala @@ -106,7 +106,7 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine, if (info.get_file_type () != FileType.DIRECTORY) { this.containers.push_tail (this.parent); } - Idle.add (this.on_idle); + this.on_idle (); } else { this.completed (); } @@ -361,6 +361,6 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine, this.containers.pop_head (); } - Idle.add (this.on_idle); + this.on_idle (); } } diff --git a/src/plugins/media-export/rygel-media-export-metadata-extractor.vala b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala index c38525e..8c29212 100644 --- a/src/plugins/media-export/rygel-media-export-metadata-extractor.vala +++ b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala @@ -65,20 +65,9 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object { this.extract_metadata = true; } - if (this.extract_metadata) { - var gst_timeout = (ClockTime) (this.timeout * Gst.SECOND); - this.discoverer = new GUPnP.DLNADiscoverer (gst_timeout, - true, - true); - this.discoverer.done.connect (on_done); - this.discoverer.start (); - } - } - - ~MetadataExtractor () { if (this.extract_metadata) { - this.discoverer.stop (); + } } @@ -86,6 +75,12 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object { if (this.extract_metadata) { string uri = file.get_uri (); this.file_hash.set (uri, file); + var gst_timeout = (ClockTime) (this.timeout * Gst.SECOND); + this.discoverer = new GUPnP.DLNADiscoverer (gst_timeout, + true, + true); + this.discoverer.done.connect (on_done); + this.discoverer.start (); this.discoverer.discover_uri (uri); } else { this.extract_basic_information (file); @@ -94,6 +89,8 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object { private void on_done (GUPnP.DLNAInformation dlna, GLib.Error err) { + this.discoverer.done.disconnect (on_done); + this.discoverer = null; var file = this.file_hash.get (dlna.info.get_uri ()); if (file == null) { warning ("File %s already handled, ignoring event",