* In case we do not have any frames to convert we'll need to break,
otherwise we end up in an endless loop. This only happened when the remaining raw data provided did not contain enough content. In this particular case there were only 2 bytes remaining though the decoder needed 4 bytes to handle at least 1 frame. Seems like the audio file only provided data for one channel in the end, which did not lead to a B_LAST_BUFFER_ERROR yet as it has been read properly. * This fixes bug 1708 and most probably 1275 as well (someone check and close please) Didn't we just have a discussion about Media handling killing the system :P git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26827 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
2b273dbc5d
commit
34faa5f214
@ -489,6 +489,9 @@ RawDecoder::Decode(void *buffer, int64 *frameCount,
|
||||
continue;
|
||||
}
|
||||
int32 frames = min_c(fOutputBufferFrameCount - *frameCount, fChunkSize / fInputFrameSize);
|
||||
if (frames == 0)
|
||||
break;
|
||||
|
||||
int32 samples = frames * fInputFormat.u.raw_audio.channel_count;
|
||||
fConvert(output_buffer, fChunkBuffer, samples);
|
||||
fChunkBuffer = (const char *)fChunkBuffer + frames * fInputFrameSize;
|
||||
|
Loading…
Reference in New Issue
Block a user