diff options
author | Max Kellermann <max@duempel.org> | 2009-03-26 19:50:10 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-26 19:50:10 +0100 |
commit | 52575d1b9da611a2b766e6f96fb838ff49e17771 (patch) | |
tree | 3c457c85268816ec2dabcee03627fd6819bb680a /src/mixer/pulse_mixer.c | |
parent | cd4964cdeee41abab7773fc0c9dd6d5592351726 (diff) | |
download | mpd-52575d1b9da611a2b766e6f96fb838ff49e17771.tar.gz mpd-52575d1b9da611a2b766e6f96fb838ff49e17771.tar.xz mpd-52575d1b9da611a2b766e6f96fb838ff49e17771.zip |
pulse: make configuration strings const
Nobody needs to modify these strings. We can make them const, and
convert config_dup_block_string() to config_get_block_string(). This
also fixes memory leaks in the pulse mixer.
Diffstat (limited to '')
-rw-r--r-- | src/mixer/pulse_mixer.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mixer/pulse_mixer.c b/src/mixer/pulse_mixer.c index 883a7ffd8..0a83755f7 100644 --- a/src/mixer/pulse_mixer.c +++ b/src/mixer/pulse_mixer.c @@ -31,9 +31,9 @@ struct pulse_mixer { struct mixer base; - char *server; - char *sink; - char *output_name; + const char *server; + const char *sink; + const char *output_name; uint32_t index; bool online; struct pa_context *context; @@ -170,9 +170,9 @@ pulse_mixer_init(const struct config_param *param) pm->volume = g_new(struct pa_cvolume,1); - pm->server = config_dup_block_string(param, "server", NULL); - pm->sink = config_dup_block_string(param, "sink", NULL); - pm->output_name = config_dup_block_string(param, "name", NULL); + pm->server = config_get_block_string(param, "server", NULL); + pm->sink = config_get_block_string(param, "sink", NULL); + pm->output_name = config_get_block_string(param, "name", NULL); return &pm->base; } |