avifil32: Fix header suggested buffersize.

This commit is contained in:
Julius Schwartzenberg 2010-01-12 00:30:55 +01:00 committed by Alexandre Julliard
parent cf73a26c6b
commit 6a5e443f3f
2 changed files with 11 additions and 5 deletions

View File

@ -1655,7 +1655,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
This->fInfo.dwCaps = AVIFILECAPS_CANREAD|AVIFILECAPS_CANWRITE;
This->fInfo.dwLength = MainAVIHdr.dwTotalFrames;
This->fInfo.dwStreams = MainAVIHdr.dwStreams;
This->fInfo.dwSuggestedBufferSize = MainAVIHdr.dwSuggestedBufferSize;
This->fInfo.dwSuggestedBufferSize = 0;
This->fInfo.dwWidth = MainAVIHdr.dwWidth;
This->fInfo.dwHeight = MainAVIHdr.dwHeight;
LoadStringW(AVIFILE_hModule, IDS_AVIFILETYPE, This->fInfo.szFileType,
@ -1757,8 +1757,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
pStream->sInfo.dwRate = streamHdr.dwRate;
pStream->sInfo.dwStart = streamHdr.dwStart;
pStream->sInfo.dwLength = streamHdr.dwLength;
pStream->sInfo.dwSuggestedBufferSize =
streamHdr.dwSuggestedBufferSize;
pStream->sInfo.dwSuggestedBufferSize = 0;
pStream->sInfo.dwQuality = streamHdr.dwQuality;
pStream->sInfo.dwSampleSize = streamHdr.dwSampleSize;
pStream->sInfo.rcFrame.left = streamHdr.rcFrame.left;
@ -1907,6 +1906,13 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
}
}
for (nStream = 0; nStream < This->fInfo.dwStreams; nStream++)
{
DWORD sugbuf = This->ppStreams[nStream]->sInfo.dwSuggestedBufferSize;
if (This->fInfo.dwSuggestedBufferSize < sugbuf)
This->fInfo.dwSuggestedBufferSize = sugbuf;
}
/* find other chunks */
FindChunkAndKeepExtras(&This->fileextra, This->hmmio, &ck, &ckRIFF, 0);

View File

@ -311,7 +311,7 @@ static void test_default_data(void)
ok(asi0.dwStart == 0, "got %u (expected 0)\n", asi0.dwStart);
ok(asi0.dwLength == 1, "got %u (expected 1)\n", asi0.dwLength);
ok(asi0.dwInitialFrames == 0, "got %u (expected 0)\n", asi0.dwInitialFrames);
todo_wine { ok(asi0.dwSuggestedBufferSize == 0, "got %u (expected 0)\n", asi0.dwSuggestedBufferSize); }
ok(asi0.dwSuggestedBufferSize == 0, "got %u (expected 0)\n", asi0.dwSuggestedBufferSize);
ok(asi0.dwQuality == 0xffffffff, "got 0x%x (expected 0xffffffff)\n", asi0.dwQuality);
ok(asi0.dwSampleSize == 0, "got %u (expected 0)\n", asi0.dwSampleSize);
ok(asi0.rcFrame.left == 0, "got %u (expected 0)\n", asi0.rcFrame.left);
@ -331,7 +331,7 @@ static void test_default_data(void)
ok(asi1.dwStart == 0, "got %u (expected 0)\n", asi1.dwStart);
ok(asi1.dwLength == 1637, "got %u (expected 1637)\n", asi1.dwLength);
ok(asi1.dwInitialFrames == 0, "got %u (expected 0)\n", asi1.dwInitialFrames);
todo_wine { ok(asi1.dwSuggestedBufferSize == 0, "got %u (expected 0)\n", asi1.dwSuggestedBufferSize); }
ok(asi1.dwSuggestedBufferSize == 0, "got %u (expected 0)\n", asi1.dwSuggestedBufferSize);
ok(asi1.dwQuality == 0xffffffff, "got 0x%x (expected 0xffffffff)\n", asi1.dwQuality);
ok(asi1.dwSampleSize == 2, "got %u (expected 2)\n", asi1.dwSampleSize);
ok(asi1.rcFrame.left == 0, "got %u (expected 0)\n", asi1.rcFrame.left);