Here are some bugfixes for avifile that Maarten mainly did during WineConf. The behaviour corresponds to what native avifil32 does. I will add tests to show this and submit the patches then. (Maybe avifil32 does a few more hacks like these, I'll add those too when I find them when creating tests.)
If anyone has any comments on the patches as they are now already, please let me know.
Thanks! Julius
From 2e9c13211c0343fd59faf835a1d954416ab46203 Mon Sep 17 00:00:00 2001 From: Julius Schwartzenberg julius.schwartzenberg@gmail.com Date: Sun, 8 Nov 2009 15:18:26 +0100 Subject: [PATCH 1/3] avifile: Fix header for audio stream
--- dlls/avifil32/avifile.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c index 49e141f..4ecc6f6 100644 --- a/dlls/avifil32/avifile.c +++ b/dlls/avifil32/avifile.c @@ -1816,7 +1816,15 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This) if (FAILED(hr)) return hr; }; - + if (pStream->lpFormat != NULL && pStream->sInfo.fccType == streamtypeAUDIO) + { + WAVEFORMATEX *wfx = pStream->lpFormat; + wfx->nBlockAlign = wfx->nChannels * wfx->wBitsPerSample / 8; + pStream->sInfo.dwSampleSize = wfx->nBlockAlign; + TRACE("Block size reset to %u, chan=%u bpp=%u\n", wfx->nBlockAlign, wfx->nChannels, wfx->wBitsPerSample); + pStream->sInfo.dwScale = 1; + pStream->sInfo.dwRate = wfx->nSamplesPerSec; + } if (mmioAscend(This->hmmio, &ck, 0) != S_OK) return AVIERR_FILEREAD; }
On Di, 2009-11-10 at 00:43 +0100, Julius Schwartzenberg wrote:
I will add tests to show this and submit the patches then.
I created a test for avifil32 in June 2008, but it was not comitted. ( http://www.winehq.org/pipermail/wine-patches/2008-June/056310.html )
The bug 14085 was created to document the required feature: http://bugs.winehq.org/show_bug.cgi?id=14085
an importlib for multiple dlls is not supported (avicap32 + avifil32 + msvfw32 => vfw32)
You can and should create tests (crosscompile them to check the Windows results and to verify the implementation changes) and send them as a seperate patch, but the patche can't be comitted before bug 14085 is fixed.
Detlef Riekenberg wrote:
On Di, 2009-11-10 at 00:43 +0100, Julius Schwartzenberg wrote:
I will add tests to show this and submit the patches then.
I created a test for avifil32 in June 2008, but it was not comitted. ( http://www.winehq.org/pipermail/wine-patches/2008-June/056310.html )
Thanks for the pointer. I was already wondering why there were no tests in the avifil32 directory. I'll keep this in mind. There are some tests that use avifile in winmm though.
Julius