From db654cddd2ffe7437f64dbead37a6b89fb3afcb2 Mon Sep 17 00:00:00 2001 From: Philipp Hahn Date: Mon, 1 Jul 2002 11:41:20 +0000 Subject: FIX: Set buffer-time instead of buffer-size CVS patchset: 2183 CVS date: 2002/07/01 11:41:20 --- src/audio_out/audio_alsa_out.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index 6cfcd0cb6..c73232314 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 * * - * $Id: audio_alsa_out.c,v 1.64 2002/07/01 11:38:59 pmhahn Exp $ + * $Id: audio_alsa_out.c,v 1.65 2002/07/01 11:41:20 pmhahn Exp $ */ #ifdef HAVE_CONFIG_H @@ -293,10 +293,9 @@ static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int printf ("audio_alsa_out: audio rate : %d requested, %d provided by device/sec\n", this->input_sample_rate, this->output_sample_rate); } - /* ERROR: Set buffer size [samples] */ - buffer_size = snd_pcm_hw_params_set_buffer_size_near(this->audio_fd, params, - 500000); - if (buffer_size < 0) { + /* set the ring-buffer time [us] (large enough for x us|y samples ...) */ + err = snd_pcm_hw_params_set_buffer_time_near(this->audio_fd, params, 500000, &dir); + if (err < 0) { printf ("audio_alsa_out: buffer time not available\n"); goto __close; } -- cgit v1.2.3