Commit 9074f924 authored by Max Kellermann's avatar Max Kellermann

alsa: initialize "device" with NULL

When using autodetection, AlsaData.device wasn't properly initialized with NULL. This broke autodetection randomly.
parent e6f334a0
...@@ -57,6 +57,7 @@ static AlsaData *newAlsaData(void) ...@@ -57,6 +57,7 @@ static AlsaData *newAlsaData(void)
{ {
AlsaData *ret = xmalloc(sizeof(AlsaData)); AlsaData *ret = xmalloc(sizeof(AlsaData));
ret->device = NULL;
ret->mode = 0; ret->mode = 0;
ret->pcmHandle = NULL; ret->pcmHandle = NULL;
ret->writei = snd_pcm_writei; ret->writei = snd_pcm_writei;
...@@ -80,8 +81,6 @@ alsa_configure(AlsaData *ad, ConfigParam *param) ...@@ -80,8 +81,6 @@ alsa_configure(AlsaData *ad, ConfigParam *param)
if ((bp = getBlockParam(param, "device"))) if ((bp = getBlockParam(param, "device")))
ad->device = xstrdup(bp->value); ad->device = xstrdup(bp->value);
else
ad->device = NULL;
ad->useMmap = getBoolBlockParam(param, "use_mmap", 1); ad->useMmap = getBoolBlockParam(param, "use_mmap", 1);
if (ad->useMmap == CONF_BOOL_UNSET) if (ad->useMmap == CONF_BOOL_UNSET)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment