Mercurial > audlegacy-plugins
comparison src/alsa-ng/alsa-core.c @ 3186:2e988f44b85d
alsa-ng: Don't crash on SND_PCM_FORMAT_UNKNOWN.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Fri, 19 Jun 2009 08:23:51 -0500 |
parents | b009fad90e92 |
children | 68bb898b8ae0 |
comparison
equal
deleted
inserted
replaced
3185:d3cf6d14c960 | 3186:2e988f44b85d |
---|---|
288 gint err, bitwidth, ringbuf_size; | 288 gint err, bitwidth, ringbuf_size; |
289 snd_pcm_format_t afmt; | 289 snd_pcm_format_t afmt; |
290 snd_pcm_hw_params_t *hwparams = NULL; | 290 snd_pcm_hw_params_t *hwparams = NULL; |
291 | 291 |
292 afmt = alsaplug_format_convert(fmt); | 292 afmt = alsaplug_format_convert(fmt); |
293 if (afmt == SND_PCM_FORMAT_UNKNOWN) | |
294 { | |
295 _ERROR("unsupported format requested: %d -> %d", fmt, afmt); | |
296 return -1; | |
297 } | |
293 | 298 |
294 if ((err = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0)) < 0) | 299 if ((err = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0)) < 0) |
295 { | 300 { |
296 _ERROR("snd_pcm_open: %s", snd_strerror(err)); | 301 _ERROR("snd_pcm_open: %s", snd_strerror(err)); |
297 pcm_handle = NULL; | 302 pcm_handle = NULL; |