[grilo] core: Ignore errors from metadata sources in grl_media_source_metadata()



commit 81e0a294ee649262a1ccc8c43887ee22966102c9
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Thu Mar 3 17:02:41 2011 +0000

    core: Ignore errors from metadata sources in grl_media_source_metadata()
    
    When invoking grl_source_metadata(), core can invoke several metadata sources
    to get information from different keys.
    
    It can happen that some of this sources can fail with an error. As we cannot
    send several errors in a shot, the best approach is to just print a warning and
    ignore the error.
    
    From an user point of view, it means that some keys could not be solved, no
    matter if due an error or because metadata cannot resolve it.
    
    Hence, an error in grl_media_source_metadata() means that the media source is
    the one who failed.
    
    Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>

 src/grl-media-source.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/grl-media-source.c b/src/grl-media-source.c
index fa0a67a..1e6d3e6 100644
--- a/src/grl-media-source.c
+++ b/src/grl-media-source.c
@@ -1269,8 +1269,7 @@ metadata_full_resolution_done_cb (GrlMetadataSource *source,
   }
 
   if (cb_info->pending_callbacks == 0) {
-    GError *_error = (GError *)error;
-    gboolean should_free_error = FALSE;
+    GError *_error = NULL;
     if (operation_is_cancelled (cb_info->source,
                                 cb_info->ctl_info->metadata_id)) {
       /* if the plugin already set an error, we don't care because we're
@@ -1279,15 +1278,15 @@ metadata_full_resolution_done_cb (GrlMetadataSource *source,
                            "Operation was cancelled");
       /* Yet, we should free the error we just created (if we didn't create it,
        * the plugin owns it) */
-      should_free_error = TRUE;
     }
     cb_info->user_callback (cb_info->source,
 			    media,
 			    cb_info->user_data,
 			    _error);
 
-    if (should_free_error && _error)
+    if (_error) {
       g_error_free (_error);
+    }
 
     g_list_free (cb_info->ctl_info->keys);
     g_free (cb_info->ctl_info);



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