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().
This commit is contained in:
parent
aec4fe06b5
commit
114d5982bb
@ -54,7 +54,8 @@ oss_mixer_init(const struct config_param *param)
|
|||||||
|
|
||||||
mixer_init(&om->base, &oss_mixer);
|
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->control = config_get_block_string(param, "mixer_control", NULL);
|
||||||
|
|
||||||
om->device_fd = -1;
|
om->device_fd = -1;
|
||||||
@ -99,14 +100,10 @@ static bool
|
|||||||
oss_mixer_open(struct mixer *data)
|
oss_mixer_open(struct mixer *data)
|
||||||
{
|
{
|
||||||
struct oss_mixer *om = (struct oss_mixer *) data;
|
struct oss_mixer *om = (struct oss_mixer *) data;
|
||||||
const char *device = VOLUME_MIXER_OSS_DEFAULT;
|
|
||||||
|
|
||||||
if (om->device) {
|
om->device_fd = open(om->device, O_RDONLY);
|
||||||
device = om->device;
|
if (om->device_fd < 0) {
|
||||||
}
|
g_warning("Unable to open oss mixer \"%s\"\n", om->device);
|
||||||
|
|
||||||
if ((om->device_fd = open(device, O_RDONLY)) < 0) {
|
|
||||||
g_warning("Unable to open oss mixer \"%s\"\n", device);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user