Julius Schwartzenberg : avifil32: Fix header suggested buffersize.
Alexandre Julliard
julliard at winehq.org
Thu Jan 14 11:33:35 CST 2010
Module: wine
Branch: master
Commit: 6a5e443f3fe9769ea754b44b9f5c56df8697bcc2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6a5e443f3fe9769ea754b44b9f5c56df8697bcc2
Author: Julius Schwartzenberg <julius.schwartzenberg at gmail.com>
Date: Tue Jan 12 00:30:55 2010 +0100
avifil32: Fix header suggested buffersize.
---
dlls/avifil32/avifile.c | 12 +++++++++---
dlls/avifil32/tests/api.c | 4 ++--
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c
index aa1df3b..c034a6b 100644
--- a/dlls/avifil32/avifile.c
+++ b/dlls/avifil32/avifile.c
@@ -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);
diff --git a/dlls/avifil32/tests/api.c b/dlls/avifil32/tests/api.c
index a68ce9c..f5945c2 100644
--- a/dlls/avifil32/tests/api.c
+++ b/dlls/avifil32/tests/api.c
@@ -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);
More information about the wine-cvs
mailing list