From 6341d53b82a93d277561e81c2c0a17238ca84484 Mon Sep 17 00:00:00 2001 From: beveloper Date: Sat, 6 Mar 2004 22:42:54 +0000 Subject: [PATCH] changed buffer size handling git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6921 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp b/src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp index 186f5de162..6271a9d3da 100644 --- a/src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp +++ b/src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp @@ -134,8 +134,10 @@ mp3Decoder::NegotiateOutputFormat(media_format *ioDecodedFormat) ioDecodedFormat->u.raw_audio.byte_order = B_MEDIA_HOST_ENDIAN; int frame_size = (ioDecodedFormat->u.raw_audio.format & 0xf) * ioDecodedFormat->u.raw_audio.channel_count; - if (ioDecodedFormat->u.raw_audio.buffer_size == 0 || (ioDecodedFormat->u.raw_audio.buffer_size % frame_size) != 0) + if (ioDecodedFormat->u.raw_audio.buffer_size == 0) ioDecodedFormat->u.raw_audio.buffer_size = AudioBufferSize(ioDecodedFormat->u.raw_audio); + else + ioDecodedFormat->u.raw_audio.buffer_size = (ioDecodedFormat->u.raw_audio.buffer_size / frame_size) * frame_size; if (ioDecodedFormat->u.raw_audio.channel_mask == 0) ioDecodedFormat->u.raw_audio.channel_mask = (fChannelCount == 1) ? B_CHANNEL_LEFT : B_CHANNEL_LEFT | B_CHANNEL_RIGHT;