diff options
author | Bastien Nocera <hadess@hadess.net> | 2015-03-30 16:45:15 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2015-08-25 18:31:45 +0200 |
commit | af52aa57f579026e3a6d6b4b4a757522774abd19 (patch) | |
tree | 6ecadf7d6d3026b50e8ddb769355fe0268d3dae6 | |
parent | de50ad298b88bddabd6d5cc9c1f20f93731c1f7b (diff) | |
download | grilo-af52aa57f579026e3a6d6b4b4a757522774abd19.tar.gz |
source: Only replace source ID in notify if unset
In other cases where grl_media_set_source() is used, it only sets the
source of a media if it is the special root container media, or if the
source was previously unset.
This avoids sources being overwritten when sending change notifications
when sending changes from an aggregating source (such as the one
embedded in Totem).
https://bugzilla.gnome.org/show_bug.cgi?id=747029
-rw-r--r-- | src/grl-source.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/grl-source.c b/src/grl-source.c index 2ddd823..a562239 100644 --- a/src/grl-source.c +++ b/src/grl-source.c @@ -4531,6 +4531,15 @@ grl_source_notify_change_stop (GrlSource *source, return GRL_SOURCE_GET_CLASS (source)->notify_change_stop (source, error); } +static void +grl_media_set_source_if_unset (GrlMedia *media, + const gchar *source) +{ + if (grl_media_get_source (media) != NULL) + return; + grl_media_set_source (media, source); +} + /** * grl_source_notify_change_list: * @source: a source @@ -4569,7 +4578,7 @@ void grl_source_notify_change_list (GrlSource *source, /* Set the source */ source_id = grl_source_get_id (source); g_ptr_array_foreach (changed_medias, - (GFunc) grl_media_set_source, + (GFunc) grl_media_set_source_if_unset, (gpointer) source_id); /* Add hook to free content when freeing the array */ |