alsa: initialize "device" with NULL
When using autodetection, AlsaData.device wasn't properly initialized with NULL. This broke autodetection randomly.
This commit is contained in:
parent
e6f334a088
commit
9074f924e9
@ -57,6 +57,7 @@ static AlsaData *newAlsaData(void)
|
||||
{
|
||||
AlsaData *ret = xmalloc(sizeof(AlsaData));
|
||||
|
||||
ret->device = NULL;
|
||||
ret->mode = 0;
|
||||
ret->pcmHandle = NULL;
|
||||
ret->writei = snd_pcm_writei;
|
||||
@ -80,8 +81,6 @@ alsa_configure(AlsaData *ad, ConfigParam *param)
|
||||
|
||||
if ((bp = getBlockParam(param, "device")))
|
||||
ad->device = xstrdup(bp->value);
|
||||
else
|
||||
ad->device = NULL;
|
||||
|
||||
ad->useMmap = getBoolBlockParam(param, "use_mmap", 1);
|
||||
if (ad->useMmap == CONF_BOOL_UNSET)
|
||||
|
Loading…
Reference in New Issue
Block a user