aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-24 16:56:10 +0200
committerMax Kellermann <max@duempel.org>2008-10-24 16:56:10 +0200
commite19f0a8dbc63f7eb53133820faf59400fb6e4929 (patch)
tree1028d5db31a2d2e4bb8c31cb1236727e041014f4 /src/audioOutputs
parente7cd237674e131678aa63d149ae116204a5b1a89 (diff)
downloadmpd-e19f0a8dbc63f7eb53133820faf59400fb6e4929.tar.gz
mpd-e19f0a8dbc63f7eb53133820faf59400fb6e4929.tar.xz
mpd-e19f0a8dbc63f7eb53133820faf59400fb6e4929.zip
jack: added assertions against partial frames
We must never pass partial frames. Added assertions to debug this.
Diffstat (limited to '')
-rw-r--r--src/audioOutputs/audioOutput_jack.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/audioOutputs/audioOutput_jack.c b/src/audioOutputs/audioOutput_jack.c
index b7d09792f..c099b5439 100644
--- a/src/audioOutputs/audioOutput_jack.c
+++ b/src/audioOutputs/audioOutput_jack.c
@@ -132,6 +132,7 @@ static int process(jack_nframes_t nframes, void *arg)
for (unsigned i = 0; i < 2; ++i) {
available = jack_ringbuffer_read_space(jd->ringbuffer[i]);
+ assert(available % sample_size == 0);
available /= sample_size;
if (available > nframes)
available = nframes;
@@ -368,6 +369,7 @@ static int jack_playAudio(void *data,
return 0;
}
+ assert(size % frame_size == 0);
size /= frame_size;
while (size > 0 && !jd->shutdown) {
space = jack_ringbuffer_write_space(jd->ringbuffer[0]);