diff options
author | Max Kellermann <max@duempel.org> | 2009-01-25 16:04:03 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-25 16:04:03 +0100 |
commit | 3635c93acbc3da87880e886d924020c427d1774a (patch) | |
tree | 4143b680e78794866744b3ac1d0a721d738872c2 /src/output/oss_plugin.c | |
parent | 5f7791009790dc40f2d76be310ffeab55c242ced (diff) | |
download | mpd-3635c93acbc3da87880e886d924020c427d1774a.tar.gz mpd-3635c93acbc3da87880e886d924020c427d1774a.tar.xz mpd-3635c93acbc3da87880e886d924020c427d1774a.zip |
conf: allow param==NULL
Return the default value in the conf_get_block_*() functions when
param==NULL was passed.
This simplifies a lot of code, because all initialization can be done
in one code path, regardless whether configuration is present.
Diffstat (limited to 'src/output/oss_plugin.c')
-rw-r--r-- | src/output/oss_plugin.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/output/oss_plugin.c b/src/output/oss_plugin.c index b27aa1b77..b80024b29 100644 --- a/src/output/oss_plugin.c +++ b/src/output/oss_plugin.c @@ -392,16 +392,14 @@ oss_initDriver(G_GNUC_UNUSED struct audio_output *audioOutput, G_GNUC_UNUSED const struct audio_format *audio_format, const struct config_param *param) { - if (param) { - const char *device = - config_get_block_string(param, "device", NULL); - if (device != NULL) { - OssData *od = newOssData(); - od->device = device; - mixer_configure(&od->mixer, param); - return od; - } + const char *device = config_get_block_string(param, "device", NULL); + if (device != NULL) { + OssData *od = newOssData(); + od->device = device; + mixer_configure(&od->mixer, param); + return od; } + return oss_open_default(param); } |