[grilo] core: Properly pass store spec to store_relay_cb()
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] core: Properly pass store spec to store_relay_cb()
- Date: Tue, 2 Oct 2012 07:17:16 +0000 (UTC)
commit 02d9befee7c3bf172714a3627afef2c9b5e3b650
Author: Mathias Hasselmann <mathias openismus com>
Date: Sun Sep 30 21:47:29 2012 +0200
core: Properly pass store spec to store_relay_cb()
This fixes https://bugzilla.gnome.org/show_bug.cgi?id=685161
src/grl-source.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/grl-source.c b/src/grl-source.c
index 3810158..dc63e36 100644
--- a/src/grl-source.c
+++ b/src/grl-source.c
@@ -166,6 +166,7 @@ struct StoreRelayCb {
GrlWriteFlags flags;
GrlSourceStoreCb user_callback;
gpointer user_data;
+ GrlSourceStoreSpec *spec;
};
struct StoreMetadataRelayCb {
@@ -2553,13 +2554,14 @@ store_relay_cb (GrlSource *source,
gpointer user_data,
const GError *error)
{
- GrlSourceStoreSpec *ss = (GrlSourceStoreSpec *) user_data;
- struct StoreRelayCb *src = (struct StoreRelayCb *) ss->user_data;
+ struct StoreRelayCb *src = (struct StoreRelayCb *) user_data;
+ GrlSourceStoreSpec *ss = src->spec;
GRL_DEBUG (__FUNCTION__);
if (error || src->flags & GRL_WRITE_NORMAL) {
- src->user_callback (source, media, failed_keys, src->user_data, error);
+ if (src->user_callback)
+ src->user_callback (source, media, failed_keys, src->user_data, error);
} else {
run_store_metadata (source, media, failed_keys, GRL_WRITE_FULL,
src->user_callback, src->user_data);
@@ -4034,6 +4036,8 @@ grl_source_store_impl (GrlSource *source,
ss->callback = store_relay_cb;
ss->user_data = src;
+ src->spec = ss;
+
g_idle_add (store_idle, ss);
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]