From 3140b9f1001afb341e085858c393a187426b67cc Mon Sep 17 00:00:00 2001 From: Julius Schwartzenberg Date: Wed, 30 Dec 2009 02:26:19 +0100 Subject: Overwrite dwRate in the audiostream with the nBlockAlign from the wave header --- dlls/avifil32/avifile.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c index 49e141f..58d70d2 100644 --- a/dlls/avifil32/avifile.c +++ b/dlls/avifil32/avifile.c @@ -1816,7 +1816,14 @@ 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; could be added */ + pStream->sInfo.dwSampleSize = wfx->nBlockAlign; /* to deal with corrupt wfx->nBlockAlign but Windows doesn't do this */ + 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; } -- 1.6.3.3