diff options
author | waker <wakeroid@gmail.com> | 2011-01-09 19:21:26 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-01-09 19:21:26 +0100 |
commit | 7ccb9b11e6033d0ee3d8351a42d4c18318c61634 (patch) | |
tree | 2c9adba2ac8e0d3dd89fc6c7a7915e808477da62 /plugins/alsa | |
parent | 9933ff9266ecc74d13b36ad8a4ece85f06da7270 (diff) |
alsa: set default format if attempted to start playback without prior setformat call
Diffstat (limited to 'plugins/alsa')
-rw-r--r-- | plugins/alsa/alsa.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/alsa/alsa.c b/plugins/alsa/alsa.c index 89d66ad0..8c66c1fa 100644 --- a/plugins/alsa/alsa.c +++ b/plugins/alsa/alsa.c @@ -117,6 +117,15 @@ palsa_set_hw_params (ddb_waveformat_t *fmt) { snd_pcm_hw_params_t *hw_params = NULL; int err = 0; + if (!fmt->channels) { + // generic format + fmt->bps = 16; + fmt->is_float = 0; + fmt->channels = 2; + fmt->samplerate = 44100; + fmt->channelmask = 3; + } + if ((err = snd_pcm_hw_params_malloc (&hw_params)) < 0) { fprintf (stderr, "cannot allocate hardware parameter structure (%s)\n", snd_strerror (err)); |