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.c2
-rw-r--r--src/audioOutputs/audioOutput_shout_mp3.c2
-rw-r--r--src/audioOutputs/audioOutput_shout_ogg.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/audioOutputs/audioOutput_alsa.c b/src/audioOutputs/audioOutput_alsa.c
index 83c4f228c..995ee3a9a 100644
--- a/src/audioOutputs/audioOutput_alsa.c
+++ b/src/audioOutputs/audioOutput_alsa.c
@@ -289,7 +289,7 @@ configure_hw:
if (err < 0)
goto error;
- ad->sampleSize = (audioFormat->bits / 8) * audioFormat->channels;
+ ad->sampleSize = audio_format_sample_size(audioFormat) * audioFormat->channels;
audioOutput->open = 1;
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;
diff --git a/src/audioOutputs/audioOutput_shout_mp3.c b/src/audioOutputs/audioOutput_shout_mp3.c
index 7bc3b5fba..d3ec0b75b 100644
--- a/src/audioOutputs/audioOutput_shout_mp3.c
+++ b/src/audioOutputs/audioOutput_shout_mp3.c
@@ -141,7 +141,7 @@ static int shout_mp3_encoder_encode(struct shout_data *sd,
float (*lamebuf)[2];
struct shout_buffer *buf = &(sd->buf);
unsigned int samples;
- int bytes = sd->audio_format.bits / 8;
+ int bytes = audio_format_sample_size(&sd->audio_format);
struct lame_data *ld = (struct lame_data *)sd->encoder_data;
int bytes_out;
diff --git a/src/audioOutputs/audioOutput_shout_ogg.c b/src/audioOutputs/audioOutput_shout_ogg.c
index 9605f9737..d8627a007 100644
--- a/src/audioOutputs/audioOutput_shout_ogg.c
+++ b/src/audioOutputs/audioOutput_shout_ogg.c
@@ -257,7 +257,7 @@ static int shout_ogg_encoder_encode(struct shout_data *sd,
int j;
float **vorbbuf;
unsigned int samples;
- int bytes = sd->audio_format.bits / 8;
+ int bytes = audio_format_sample_size(&sd->audio_format);
struct ogg_vorbis_data *od = (struct ogg_vorbis_data *)sd->encoder_data;
samples = size / (bytes * sd->audio_format.channels);