aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-23 16:48:49 +0200
committerMax Kellermann <max@duempel.org>2008-10-23 16:48:49 +0200
commit980f2ca56dbedb60aa3f880f66a97d151a107e62 (patch)
treeea209a4c759052d0fba121939edb2b0de9bdb7fc /src/audio.c
parent4f807b3aaa9617dfc35fb73ec898c8c9a22fded4 (diff)
downloadmpd-980f2ca56dbedb60aa3f880f66a97d151a107e62.tar.gz
mpd-980f2ca56dbedb60aa3f880f66a97d151a107e62.tar.xz
mpd-980f2ca56dbedb60aa3f880f66a97d151a107e62.zip
output_buffer: don't split frames
Splitting a frame between two buffer chunks causes distortion in the output. MPD used to assume that the chunk size 1020 would never cause splitted frames, but that isn't the case for 24 bit stereo (127.5 frames), and even less for files with even more channels.
Diffstat (limited to '')
-rw-r--r--src/audio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/audio.c b/src/audio.c
index 4305235d0..7d8e49f77 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -254,6 +254,9 @@ int playAudio(const char *buffer, size_t length)
int ret = -1, err;
unsigned int i;
+ /* no partial frames allowed */
+ assert((length % audio_format_frame_size(&input_audio_format)) == 0);
+
syncAudioDeviceStates();
for (i = 0; i < audioOutputArraySize; ++i)