*/
#include "private_mciavi.h"
-#include <wine/debug.h>
+#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mciavi);
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;
}
}
-LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC)
+double MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC)
{
void* pBitmapData;
LPBITMAPINFO pBitmapInfo;
if (!hDC || !wma->inbih)
- return TRUE;
+ return 0;
TRACE("Painting frame %u (cached %u)\n", wma->dwCurrVideoFrame, wma->dwCachedFrame);
if (wma->dwCurrVideoFrame != wma->dwCachedFrame)
{
if (!wma->lpVideoIndex[wma->dwCurrVideoFrame].dwOffset)
- return FALSE;
+ return 0;
if (wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize)
{
wma->outbih, wma->outdata) != ICERR_OK)
{
WARN("Decompression error\n");
- return FALSE;
+ return 0;
}
}
wma->source.right - wma->source.left, wma->source.bottom - wma->source.top,
pBitmapData, pBitmapInfo, DIB_RGB_COLORS, SRCCOPY);
- return TRUE;
+ return (wma->ash_video.dwScale / (double)wma->ash_video.dwRate) * 1000000;
}