diff options
author | Lennart Poettering <lennart@poettering.net> | 2008-08-14 00:53:57 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-08-14 00:53:57 +0200 |
commit | 86cc8cfa244789eda3bcb0ab1326dbc8e3f6b9fd (patch) | |
tree | 02a6be4cdf26f71b54a8d774dbc120422e63f1bf /src | |
parent | b9d17d64d5bfcd49164c6cf703134a063b7ad020 (diff) |
fall back to filename property if event id property doesn't exist
Diffstat (limited to 'src')
-rw-r--r-- | src/sound-theme-spec.c | 11 |
1 files 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); |