From 0142ce330746d598392f9f9fb1555ca7412566b1 Mon Sep 17 00:00:00 2001 From: Philipp Hahn Date: Wed, 3 Jul 2002 07:50:20 +0000 Subject: Calculate b/f the alsa way CVS patchset: 2202 CVS date: 2002/07/03 07:50:20 --- src/audio_out/audio_alsa_out.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index 9e7bc536a..36aa02090 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.71 2002/07/03 07:44:04 pmhahn Exp $ + * $Id: audio_alsa_out.c,v 1.72 2002/07/03 07:50:20 pmhahn Exp $ */ #ifdef HAVE_CONFIG_H @@ -245,8 +245,6 @@ static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int this->input_sample_rate = rate; this->bits_per_sample = bits; this->bytes_in_buffer = 0; - /* FIXME: Can use an ALSA function here */ - this->bytes_per_frame=(this->bits_per_sample*this->num_channels)/8; /* * open audio device */ @@ -333,6 +331,7 @@ static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int goto __close; } this->sample_rate_factor = (double) this->output_sample_rate / (double) this->input_sample_rate; + this->bytes_per_frame = snd_pcm_frames_to_bytes (this->audio_fd, 1); /* * audio buffer size handling */ @@ -456,8 +455,7 @@ static int ao_alsa_write(ao_driver_t *this_gen,int16_t *data, uint32_t count) buffer += result * this->bytes_per_frame; } } - /* FIXME: What should this really be? */ - return 1; + return 1; /* audio samples were processed ok */ } static void ao_alsa_close(ao_driver_t *this_gen) -- cgit v1.2.3