aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs
diff options
context:
space:
mode:
Diffstat (limited to 'src/audioOutputs')
-rw-r--r--src/audioOutputs/audioOutput_alsa.c2
-rw-r--r--src/audioOutputs/audioOutput_osx.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/audioOutputs/audioOutput_alsa.c b/src/audioOutputs/audioOutput_alsa.c
index 30ad449f3..9d47ff244 100644
--- a/src/audioOutputs/audioOutput_alsa.c
+++ b/src/audioOutputs/audioOutput_alsa.c
@@ -288,7 +288,7 @@ configure_hw:
if (err < 0)
goto error;
- ad->sampleSize = audio_format_sample_size(audioFormat) * audioFormat->channels;
+ ad->sampleSize = audio_format_frame_size(audioFormat);
DEBUG("ALSA device \"%s\" will be playing %i bit, %u channel audio at "
"%u Hz\n", ad->device, audioFormat->bits,
diff --git a/src/audioOutputs/audioOutput_osx.c b/src/audioOutputs/audioOutput_osx.c
index 1fc0a5d9e..65060cc8c 100644
--- a/src/audioOutputs/audioOutput_osx.c
+++ b/src/audioOutputs/audioOutput_osx.c
@@ -266,8 +266,7 @@ static int osx_openDevice(struct audio_output *audioOutput,
streamDesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian;
#endif
- streamDesc.mBytesPerPacket =
- audioFormat->channels * audio_format_sample_size(audioFormat);
+ streamDesc.mBytesPerPacket = audio_format_frame_size(audioFormat);
streamDesc.mFramesPerPacket = 1;
streamDesc.mBytesPerFrame = streamDesc.mBytesPerPacket;
streamDesc.mChannelsPerFrame = audioFormat->channels;
@@ -284,7 +283,7 @@ static int osx_openDevice(struct audio_output *audioOutput,
/* create a buffer of 1s */
od->bufferSize = (audioFormat->sample_rate) *
- (audioFormat->bits >> 3) * (audioFormat->channels);
+ audio_format_frame_size(audioFormat);
od->buffer = xrealloc(od->buffer, od->bufferSize);
od->pos = 0;