summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames Courtier-Dutton <jcdutton@users.sourceforge.net>2003-10-12 13:35:49 +0000
committerJames Courtier-Dutton <jcdutton@users.sourceforge.net>2003-10-12 13:35:49 +0000
commit665f04052a9a91b3aee5f427146460e13d1299e7 (patch)
treea1f5f9c3f14ca9627dce18f7b9e0fea66c02de22 /src
parent273e59acfe6489778d04c35ecc9da25dae9c5015 (diff)
downloadxine-lib-665f04052a9a91b3aee5f427146460e13d1299e7.tar.gz
xine-lib-665f04052a9a91b3aee5f427146460e13d1299e7.tar.bz2
Fix "audio_alsa_out: buffer to small, could not use" for some sound cards.
Fix was to set period size before buffer size. CVS patchset: 5487 CVS date: 2003/10/12 13:35:49
Diffstat (limited to 'src')
-rw-r--r--src/audio_out/audio_alsa_out.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c
index 4d563cce6..0f73cd06f 100644
--- a/src/audio_out/audio_alsa_out.c
+++ b/src/audio_out/audio_alsa_out.c
@@ -26,7 +26,7 @@
* (c) 2001 James Courtier-Dutton <James@superbug.demon.co.uk>
*
*
- * $Id: audio_alsa_out.c,v 1.114 2003/10/07 17:25:10 jcdutton Exp $
+ * $Id: audio_alsa_out.c,v 1.115 2003/10/12 13:35:49 jcdutton Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -484,13 +484,6 @@ static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int
goto __close;
}
#endif
- dir=0;
- err = snd_pcm_hw_params_set_buffer_size_near(this->audio_fd, params, &this->buffer_size);
- if (err < 0) {
- printf ("audio_alsa_out: buffer time not available: %s\n", snd_strerror(err));
- goto __close;
- }
- err = snd_pcm_hw_params_get_buffer_size(params, &(this->buffer_size));
#if 1
/* set the period time [us] (interrupt every x us|y samples ...) */
dir=0;
@@ -502,9 +495,17 @@ static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int
#endif
dir=0;
err = snd_pcm_hw_params_get_period_size(params, &period_size, &dir);
+
+ dir=0;
+ err = snd_pcm_hw_params_set_buffer_size_near(this->audio_fd, params, &this->buffer_size);
+ if (err < 0) {
+ printf ("audio_alsa_out: buffer time not available: %s\n", snd_strerror(err));
+ goto __close;
+ }
+ err = snd_pcm_hw_params_get_buffer_size(params, &(this->buffer_size));
#ifdef ALSA_LOG_BUFFERS
- printf("was set buffer_size = %ld\n",this->buffer_size);
printf("was set period_size = %ld\n",period_size);
+ printf("was set buffer_size = %ld\n",this->buffer_size);
#endif
if (2*period_size > this->buffer_size) {
printf ("audio_alsa_out: buffer to small, could not use\n");