From 390cecb8a6fc1f56880759744b43d66b12e9323b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 30 Jul 2008 00:48:10 +0200 Subject: strip more properties when cacheing --- src/pulse.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pulse.c b/src/pulse.c index 785c967..06e5874 100644 --- a/src/pulse.c +++ b/src/pulse.c @@ -118,13 +118,13 @@ static int convert_proplist(pa_proplist **_l, ca_proplist *c) { return CA_SUCCESS; } -static pa_proplist *strip_canberra_data(pa_proplist *l) { +static pa_proplist *strip_prefix(pa_proplist *l, const char *prefix) { const char *key; void *state = NULL; ca_assert(l); while ((key = pa_proplist_iterate(l, &state))) - if (strncmp(key, "canberra.", 9) == 0) + if (strncmp(key, prefix, strlen(prefix)) == 0) pa_proplist_unset(l, key); return l; @@ -389,7 +389,7 @@ int driver_change_props(ca_context *c, ca_proplist *changed, ca_proplist *merged if ((ret = convert_proplist(&l, changed)) < 0) return ret; - strip_canberra_data(l); + strip_prefix(l, "canberra."); pa_threaded_mainloop_lock(p->mainloop); @@ -678,7 +678,7 @@ int driver_play(ca_context *c, uint32_t id, ca_proplist *proplist, ca_finish_cal goto finish; } - strip_canberra_data(l); + strip_prefix(l, "canberra."); if ((ret = subscribe(c)) < 0) goto finish; @@ -905,7 +905,9 @@ int driver_cache(ca_context *c, ca_proplist *proplist) { goto finish; } - strip_canberra_data(l); + strip_prefix(l, "canberra."); + strip_prefix(l, "event.mouse."); + strip_prefix(l, "window."); /* Let's stream the sample directly */ if ((ret = ca_lookup_sound(&out->file, &p->theme, c->props, proplist)) < 0) -- cgit