summaryrefslogtreecommitdiff
path: root/src/pulsecore/card.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-03-23 19:31:36 +0100
committerLennart Poettering <lennart@poettering.net>2009-03-23 19:31:36 +0100
commit08154554b0cdce6d16816536211718bf14ff33ff (patch)
treeee23e50fcd8efa03cae2d402af0a7b071ec79a3c /src/pulsecore/card.c
parent124de50ef8e4074302c0c205e61ccd78744dd549 (diff)
downloadpulseaudio-panda-08154554b0cdce6d16816536211718bf14ff33ff.tar.gz
pulseaudio-panda-08154554b0cdce6d16816536211718bf14ff33ff.tar.bz2
pulseaudio-panda-08154554b0cdce6d16816536211718bf14ff33ff.zip
only store card profile if flagged for that
Diffstat (limited to 'src/pulsecore/card.c')
-rw-r--r--src/pulsecore/card.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
index 6419c234..f268f7c9 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/card.c
@@ -143,7 +143,8 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
c->active_profile = NULL;
if (data->active_profile && c->profiles)
- c->active_profile = pa_hashmap_get(c->profiles, data->active_profile);
+ if ((c->active_profile = pa_hashmap_get(c->profiles, data->active_profile)))
+ c->save_profile = data->save_profile;
if (!c->active_profile && c->profiles) {
void *state = NULL;
@@ -209,7 +210,7 @@ void pa_card_free(pa_card *c) {
pa_xfree(c);
}
-int pa_card_set_profile(pa_card *c, const char *name) {
+int pa_card_set_profile(pa_card *c, const char *name, pa_bool_t save) {
pa_card_profile *profile;
pa_assert(c);
@@ -224,8 +225,10 @@ int pa_card_set_profile(pa_card *c, const char *name) {
if (!(profile = pa_hashmap_get(c->profiles, name)))
return -1;
- if (c->active_profile == profile)
+ if (c->active_profile == profile) {
+ c->save_profile = c->save_profile || save;
return 0;
+ }
if (c->set_profile(c, profile) < 0)
return -1;
@@ -235,6 +238,7 @@ int pa_card_set_profile(pa_card *c, const char *name) {
pa_log_info("Changed profile of card %u \"%s\" to %s", c->index, c->name, profile->name);
c->active_profile = profile;
+ c->save_profile = save;
return 0;
}