From 128d8c7c15c0713cfccc42dfeea9b0cd9ed11d14 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Sep 2008 23:59:54 +0200 Subject: audio_format: added audio_format_sample_size() The inline function audio_format_sample_size() calculates how many bytes each sample consumes. This function already takes into account that 24 bit samples are 4 bytes long, not 3. --- src/audioOutputs/audioOutput_osx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/audioOutputs/audioOutput_osx.c') diff --git a/src/audioOutputs/audioOutput_osx.c b/src/audioOutputs/audioOutput_osx.c index e8a65c453..2b17666ce 100644 --- a/src/audioOutputs/audioOutput_osx.c +++ b/src/audioOutputs/audioOutput_osx.c @@ -268,7 +268,7 @@ static int osx_openDevice(struct audio_output *audioOutput) #endif streamDesc.mBytesPerPacket = - audioFormat->channels * audioFormat->bits / 8; + audioFormat->channels * audio_format_sample_size(audioFormat); streamDesc.mFramesPerPacket = 1; streamDesc.mBytesPerFrame = streamDesc.mBytesPerPacket; streamDesc.mChannelsPerFrame = audioFormat->channels; -- cgit v1.2.3