avifil32: Use chunksize specified by the chunk itself, avoids a noticable ticking sound heard when reading past the chunk boundary.

This commit is contained in:
Julius Schwartzenberg 2010-01-20 22:57:27 +01:00 committed by Alexandre Julliard
parent b0ad0b9c0b
commit 7401af64e9
1 changed files with 4 additions and 1 deletions

View File

@ -1103,6 +1103,7 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start,
samples *= This->sInfo.dwSampleSize;
while (samples > 0 && buffersize > 0) {
LONG blocksize;
if (block != This->dwCurrentFrame) {
hr = AVIFILE_ReadBlock(This, block, NULL, 0);
if (FAILED(hr))
@ -1110,7 +1111,9 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start,
}
size = min((DWORD)samples, (DWORD)buffersize);
size = min(size, This->cbBuffer - offset);
blocksize = This->lpBuffer[1];
TRACE("blocksize = %u\n",blocksize);
size = min(size, blocksize - offset);
memcpy(buffer, ((BYTE*)&This->lpBuffer[2]) + offset, size);
block++;