diff options
author | waker <wakeroid@gmail.com> | 2009-08-17 21:45:08 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2009-08-17 21:45:08 +0200 |
commit | 4cd7148d793912b8ef97ce9265962b73d32a1c3f (patch) | |
tree | 75885de9f977581452d6359e3e0e7824a0f75292 /palsa.c | |
parent | e17823663289e21e043fbf32e8d26bc133a7b3fe (diff) |
added config file
Diffstat (limited to 'palsa.c')
-rw-r--r-- | palsa.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -22,6 +22,7 @@ #include "palsa.h" #include "threading.h" #include "streamer.h" +#include "conf.h" static inline void le_int16 (int16_t in, char *out) { @@ -57,11 +58,12 @@ palsa_init (void) { snd_pcm_hw_params_t *hw_params; snd_pcm_sw_params_t *sw_params; state = 0; + alsa_rate = conf_samplerate; - if ((err = snd_pcm_open (&audio, "default", SND_PCM_STREAM_PLAYBACK, 0))) { + if ((err = snd_pcm_open (&audio, conf_alsa_soundcard, SND_PCM_STREAM_PLAYBACK, 0))) { fprintf (stderr, "could not open audio device (%s)\n", snd_strerror (err)); - return -1; + exit (-1); } if ((err = snd_pcm_hw_params_malloc (&hw_params)) < 0) { @@ -98,6 +100,7 @@ palsa_init (void) { snd_strerror (err)); goto open_error; } + alsa_rate = val; if ((err = snd_pcm_hw_params_set_channels (audio, hw_params, 2)) < 0) { fprintf (stderr, "cannot set channel count (%s)\n", |