[gnome-music/freeze-break: 73/107] grilo: Use synchronous get_media_from_uri



commit 60ae311c5e6ea002b0e7f1b5b0fff14d9553e5a3
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Thu Sep 5 00:37:31 2013 +0800

    grilo: Use synchronous get_media_from_uri
    
    The async one causes segmentation faults.

 gnomemusic/grilo.py |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/gnomemusic/grilo.py b/gnomemusic/grilo.py
index bc2129b..afb930b 100644
--- a/gnomemusic/grilo.py
+++ b/gnomemusic/grilo.py
@@ -132,15 +132,10 @@ class Grilo(GObject.GObject):
         if not self.filesystem.test_media_from_uri(uri):
             return
         options = self.options.copy()
-        self.filesystem.get_media_from_uri(
-            uri, self.METADATA_KEYS, options,
-            self._media_from_uri_callback, callback
+        media = self.filesystem.get_media_from_uri_sync(
+            uri, self.METADATA_KEYS, options
         )
-
-    def _media_from_uri_callback(self, source, operation_id, media, data=None, error=None):
-        callback = data
-        if callback:
-            callback(media)
+        callback(media)
 
 Grl.init(None)
 


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