[rygel/rygel-0-10: 3/8] media-export: Ignore unknown file from discoverer



commit c01d3c97648f18e8007b7af7823658ec4df8697d
Author: Jens Georg <mail jensge org>
Date:   Sat Apr 23 13:57:54 2011 +0300

    media-export: Ignore unknown file from discoverer
    
    Sometimes and for some files the discoverer seems to send multiple
    events.

 .../rygel-media-export-metadata-extractor.vala     |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
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 991d990..14b325a 100644
--- a/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
+++ b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
@@ -96,9 +96,13 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object {
 
     private void on_done (GUPnP.DLNAInformation dlna,
                           GLib.Error            err) {
-        assert (this.file_hash.has_key (dlna.info.get_uri ()));
-
         var file = this.file_hash.get (dlna.info.get_uri ());
+        if (file == null) {
+            warning ("File %s already handled, ignoring event",
+                     dlna.info.get_uri ());
+
+            return;
+        }
 
         this.file_hash.unset (dlna.info.get_uri ());
 



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