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.
This commit is contained in:
Max Kellermann
2008-10-23 16:48:49 +02:00
parent 4f807b3aaa
commit 980f2ca56d
3 changed files with 16 additions and 1 deletions

View File

@@ -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)