From 86cc8cfa244789eda3bcb0ab1326dbc8e3f6b9fd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 14 Aug 2008 00:53:57 +0200 Subject: fall back to filename property if event id property doesn't exist --- src/sound-theme-spec.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sound-theme-spec.c b/src/sound-theme-spec.c index 8c78f89..f9c58d4 100644 --- a/src/sound-theme-spec.c +++ b/src/sound-theme-spec.c @@ -705,7 +705,7 @@ static int find_sound_for_theme( } int ca_lookup_sound(ca_sound_file **f, ca_theme_data **t, ca_proplist *cp, ca_proplist *sp) { - int ret; + int ret = CA_ERROR_INVALID; const char *name, *fname; ca_return_val_if_fail(f, CA_ERROR_INVALID); @@ -735,11 +735,12 @@ int ca_lookup_sound(ca_sound_file **f, ca_theme_data **t, ca_proplist *cp, ca_pr profile = DEFAULT_OUTPUT_PROFILE; ret = find_sound_for_theme(f, t, theme, name, locale, profile); + } - } else if ((fname = ca_proplist_gets_unlocked(sp, CA_PROP_MEDIA_FILENAME))) - ret = ca_sound_file_open(f, fname); - else - ret = CA_ERROR_INVALID; + if (ret == CA_ERROR_NOTFOUND || !name) { + if ((fname = ca_proplist_gets_unlocked(sp, CA_PROP_MEDIA_FILENAME))) + ret = ca_sound_file_open(f, fname); + } ca_mutex_unlock(cp->mutex); ca_mutex_unlock(sp->mutex); -- cgit