*/
#include "private_mciavi.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mciavi);
static BOOL MCIAVI_GetInfoAudio(WINE_MCIAVI* wma, const MMCKINFO* mmckList, MMCKINFO *mmckStream)
{
TRACE("bih.biClrUsed=%d\n", wma->inbih->biClrUsed);
TRACE("bih.biClrImportant=%d\n", wma->inbih->biClrImportant);
- wma->source.left = 0;
- wma->source.top = 0;
- wma->source.right = wma->inbih->biWidth;
- wma->source.bottom = wma->inbih->biHeight;
-
+ SetRect(&wma->source, 0, 0, wma->inbih->biWidth, wma->inbih->biHeight);
wma->dest = wma->source;
return TRUE;
*/
twocc = TWOCCFromFOURCC(mmck->ckid);
if (twocc == TWOCCFromFOURCC(wma->inbih->biCompression))
- twocc = cktypeDIBcompressed;
-
+ twocc = cktypeDIBcompressed;
+ /* Also detect some chunks that seem to be used by Indeo videos where the chunk is named
+ * after the codec. */
+ else if (twocc == LOWORD(wma->ash_video.fccHandler))
+ twocc = cktypeDIBcompressed;
switch (twocc) {
case cktypeDIBbits:
case cktypeDIBcompressed:
alb->numAudioBlocks, mmck->cksize);
if (wma->lpWaveFormat) {
if (alb->numAudioBlocks >= alb->numAudioAllocated) {
- alb->numAudioAllocated += 32;
- if (!wma->lpAudioIndex)
- wma->lpAudioIndex = HeapAlloc(GetProcessHeap(), 0,
- alb->numAudioAllocated * sizeof(struct MMIOPos));
- else
- wma->lpAudioIndex = HeapReAlloc(GetProcessHeap(), 0, wma->lpAudioIndex,
- alb->numAudioAllocated * sizeof(struct MMIOPos));
- if (!wma->lpAudioIndex) return FALSE;
+ DWORD newsize = alb->numAudioAllocated + 32;
+ struct MMIOPos* newindex;
+
+ if (!wma->lpAudioIndex)
+ newindex = HeapAlloc(GetProcessHeap(), 0, newsize * sizeof(struct MMIOPos));
+ else
+ newindex = HeapReAlloc(GetProcessHeap(), 0, wma->lpAudioIndex, newsize * sizeof(struct MMIOPos));
+ if (!newindex) return FALSE;
+ alb->numAudioAllocated = newsize;
+ wma->lpAudioIndex = newindex;
}
wma->lpAudioIndex[alb->numAudioBlocks].dwOffset = mmck->dwDataOffset;
wma->lpAudioIndex[alb->numAudioBlocks].dwSize = mmck->cksize;
mmioAscend(wma->hFile, &mmckInfo, 0);
}
if (alb.numVideoFrames != wma->dwPlayableVideoFrames) {
- WARN("Found %d video frames (/%d), reducing playable frames\n",
- alb.numVideoFrames, wma->dwPlayableVideoFrames);
+ WARN("AVI header says %d frames, we found %d video frames, reducing playable frames\n",
+ wma->dwPlayableVideoFrames, alb.numVideoFrames);
wma->dwPlayableVideoFrames = alb.numVideoFrames;
}
wma->dwPlayableAudioBlocks = alb.numAudioBlocks;