aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs/audioOutput_alsa.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-23 23:59:54 +0200
committerMax Kellermann <max@duempel.org>2008-09-23 23:59:54 +0200
commit128d8c7c15c0713cfccc42dfeea9b0cd9ed11d14 (patch)
tree92bb882c28b4f2621e3cccfbf1e1aa740f76a55c /src/audioOutputs/audioOutput_alsa.c
parente4f5d6bdf47c96dc9c0b5fe287598bc10b168a71 (diff)
downloadmpd-128d8c7c15c0713cfccc42dfeea9b0cd9ed11d14.tar.gz
mpd-128d8c7c15c0713cfccc42dfeea9b0cd9ed11d14.tar.xz
mpd-128d8c7c15c0713cfccc42dfeea9b0cd9ed11d14.zip
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.
Diffstat (limited to '')
-rw-r--r--src/audioOutputs/audioOutput_alsa.c2
1 files changed, 1 insertions, 1 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;