Commit 7401af64 authored by Julius Schwartzenberg's avatar Julius Schwartzenberg Committed by Alexandre Julliard

avifil32: Use chunksize specified by the chunk itself, avoids a noticable…

avifil32: Use chunksize specified by the chunk itself, avoids a noticable ticking sound heard when reading past the chunk boundary.
parent b0ad0b9c
...@@ -1103,6 +1103,7 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start, ...@@ -1103,6 +1103,7 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start,
samples *= This->sInfo.dwSampleSize; samples *= This->sInfo.dwSampleSize;
while (samples > 0 && buffersize > 0) { while (samples > 0 && buffersize > 0) {
LONG blocksize;
if (block != This->dwCurrentFrame) { if (block != This->dwCurrentFrame) {
hr = AVIFILE_ReadBlock(This, block, NULL, 0); hr = AVIFILE_ReadBlock(This, block, NULL, 0);
if (FAILED(hr)) if (FAILED(hr))
...@@ -1110,7 +1111,9 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start, ...@@ -1110,7 +1111,9 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start,
} }
size = min((DWORD)samples, (DWORD)buffersize); 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); memcpy(buffer, ((BYTE*)&This->lpBuffer[2]) + offset, size);
block++; block++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment