aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-26 19:47:47 +0100
committerMax Kellermann <max@duempel.org>2009-03-26 19:47:47 +0100
commit114d5982bbd692749727ee54ec7f7f5b9017958f (patch)
treec28ed4a3c0e7081c8667d7965294c807616cd2b4
parentaec4fe06b5b8be21f7b016a1bb23d048c8b6380c (diff)
downloadmpd-114d5982bbd692749727ee54ec7f7f5b9017958f.tar.gz
mpd-114d5982bbd692749727ee54ec7f7f5b9017958f.tar.xz
mpd-114d5982bbd692749727ee54ec7f7f5b9017958f.zip
oss_mixer: pass default path to config_get_block_string()
Instead of replacing NULL with the default path in the open() method, pass the default path to config_get_block_string().
-rw-r--r--src/mixer/oss_mixer.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mixer/oss_mixer.c b/src/mixer/oss_mixer.c
index 6143b91e4..4eb907153 100644
--- a/src/mixer/oss_mixer.c
+++ b/src/mixer/oss_mixer.c
@@ -54,7 +54,8 @@ oss_mixer_init(const struct config_param *param)
mixer_init(&om->base, &oss_mixer);
- om->device = config_get_block_string(param, "mixer_device", NULL);
+ om->device = config_get_block_string(param, "mixer_device",
+ VOLUME_MIXER_OSS_DEFAULT);
om->control = config_get_block_string(param, "mixer_control", NULL);
om->device_fd = -1;
@@ -99,14 +100,10 @@ static bool
oss_mixer_open(struct mixer *data)
{
struct oss_mixer *om = (struct oss_mixer *) data;
- const char *device = VOLUME_MIXER_OSS_DEFAULT;
- if (om->device) {
- device = om->device;
- }
-
- if ((om->device_fd = open(device, O_RDONLY)) < 0) {
- g_warning("Unable to open oss mixer \"%s\"\n", device);
+ om->device_fd = open(om->device, O_RDONLY);
+ if (om->device_fd < 0) {
+ g_warning("Unable to open oss mixer \"%s\"\n", om->device);
return false;
}