aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-24 15:47:52 +0200
committerMax Kellermann <max@duempel.org>2008-10-24 15:47:52 +0200
commit91ad576aade3c80555bf41fe88a6d1b11ae93424 (patch)
treeafcd5ac4b020cb0d7ecdd21e412480221c6882ec
parent9d6651d8b2a78cc57c56fd1c34d93b0b7a2c2e25 (diff)
downloadmpd-91ad576aade3c80555bf41fe88a6d1b11ae93424.tar.gz
mpd-91ad576aade3c80555bf41fe88a6d1b11ae93424.tar.xz
mpd-91ad576aade3c80555bf41fe88a6d1b11ae93424.zip
jack: added constant "frame_size"
Don't hard-code a frame size of "4" (16 bit stereo), calculate the sample size from sizeof(*buffer), and create the constant "frame_size".
Diffstat (limited to '')
-rw-r--r--src/audioOutputs/audioOutput_jack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/audioOutputs/audioOutput_jack.c b/src/audioOutputs/audioOutput_jack.c
index 04ad436f8..d9670b27b 100644
--- a/src/audioOutputs/audioOutput_jack.c
+++ b/src/audioOutputs/audioOutput_jack.c
@@ -389,8 +389,9 @@ static int jack_playAudio(void *data,
size_t space;
size_t i;
const short *buffer = (const short *) buff;
+ static const size_t frame_size = sizeof(*buffer) * 2;
jack_default_audio_sample_t sample;
- size_t samples = size/4;
+ size_t samples = size / frame_size;
/*DEBUG("jack_playAudio: (pid=%d)!\n", getpid());*/