ALSA - corrected passing empty config

This commit is contained in:
Martin Pulec
2012-04-14 18:10:02 +02:00
parent de3c7824a0
commit 3be1beae9f
2 changed files with 4 additions and 3 deletions

View File

@@ -86,7 +86,7 @@ void * audio_cap_alsa_init(char *cfg)
s->frame.sample_rate = 48000;
s->frame.ch_count = 2;
if(cfg) {
if(cfg && strlen(cfg) > 0) {
name = cfg;
}

View File

@@ -197,10 +197,11 @@ void * audio_play_alsa_init(char *cfg)
char *name;
s = calloc(1, sizeof(struct state_alsa_playback));
if(cfg)
if(cfg && strlen(cfg) > 0) {
name = cfg;
else
} else {
name = "default";
}
rc = snd_pcm_open(&s->handle, name,
SND_PCM_STREAM_PLAYBACK, 0);