Commit 1e942d6b authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

mciavi32: Read the stream header in order to determine its type.

parent 4d2a2860
...@@ -28,8 +28,6 @@ static BOOL MCIAVI_GetInfoAudio(WINE_MCIAVI* wma, const MMCKINFO* mmckList, MMCK ...@@ -28,8 +28,6 @@ static BOOL MCIAVI_GetInfoAudio(WINE_MCIAVI* wma, const MMCKINFO* mmckList, MMCK
{ {
MMCKINFO mmckInfo; MMCKINFO mmckInfo;
mmioRead(wma->hFile, (LPSTR)&wma->ash_audio, sizeof(wma->ash_audio));
TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_audio.fccType)), TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_audio.fccType)),
HIBYTE(LOWORD(wma->ash_audio.fccType)), HIBYTE(LOWORD(wma->ash_audio.fccType)),
LOBYTE(HIWORD(wma->ash_audio.fccType)), LOBYTE(HIWORD(wma->ash_audio.fccType)),
...@@ -91,8 +89,6 @@ static BOOL MCIAVI_GetInfoVideo(WINE_MCIAVI* wma, const MMCKINFO* mmckList, MMCK ...@@ -91,8 +89,6 @@ static BOOL MCIAVI_GetInfoVideo(WINE_MCIAVI* wma, const MMCKINFO* mmckList, MMCK
{ {
MMCKINFO mmckInfo; MMCKINFO mmckInfo;
mmioRead(wma->hFile, (LPSTR)&wma->ash_video, sizeof(wma->ash_video));
TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_video.fccType)), TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_video.fccType)),
HIBYTE(LOWORD(wma->ash_video.fccType)), HIBYTE(LOWORD(wma->ash_video.fccType)),
LOBYTE(HIWORD(wma->ash_video.fccType)), LOBYTE(HIWORD(wma->ash_video.fccType)),
...@@ -261,6 +257,7 @@ BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma) ...@@ -261,6 +257,7 @@ BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma)
MMCKINFO mmckHead; MMCKINFO mmckHead;
MMCKINFO mmckList; MMCKINFO mmckList;
MMCKINFO mmckInfo; MMCKINFO mmckInfo;
AVIStreamHeader strh;
struct AviListBuild alb; struct AviListBuild alb;
DWORD stream_n; DWORD stream_n;
...@@ -320,34 +317,40 @@ BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma) ...@@ -320,34 +317,40 @@ BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma)
continue; continue;
} }
TRACE("Stream #%d fccType %4.4s\n", stream_n, (LPSTR)&mmckStream.fccType); mmioRead(wma->hFile, (LPSTR)&strh, sizeof(strh));
TRACE("Stream #%d fccType %4.4s\n", stream_n, (LPSTR)&strh.fccType);
if (mmckStream.fccType == streamtypeVIDEO) if (strh.fccType == streamtypeVIDEO)
{ {
TRACE("found video stream\n"); TRACE("found video stream\n");
if (wma->inbih) if (wma->inbih)
WARN("ignoring another video stream\n"); WARN("ignoring another video stream\n");
else else
{ {
wma->ash_audio = strh;
if (!MCIAVI_GetInfoVideo(wma, &mmckList, &mmckStream)) if (!MCIAVI_GetInfoVideo(wma, &mmckList, &mmckStream))
return FALSE; return FALSE;
wma->video_stream_n = stream_n; wma->video_stream_n = stream_n;
} }
} }
else if (mmckStream.fccType == streamtypeAUDIO) else if (strh.fccType == streamtypeAUDIO)
{ {
TRACE("found audio stream\n"); TRACE("found audio stream\n");
if (wma->lpWaveFormat) if (wma->lpWaveFormat)
WARN("ignoring another audio stream\n"); WARN("ignoring another audio stream\n");
else else
{ {
wma->ash_video = strh;
if (!MCIAVI_GetInfoAudio(wma, &mmckList, &mmckStream)) if (!MCIAVI_GetInfoAudio(wma, &mmckList, &mmckStream))
return FALSE; return FALSE;
wma->audio_stream_n = stream_n; wma->audio_stream_n = stream_n;
} }
} }
else else
TRACE("Unsupported stream type %4.4s\n", (LPSTR)&mmckStream.fccType); TRACE("Unsupported stream type %4.4s\n", (LPSTR)&strh.fccType);
mmioAscend(wma->hFile, &mmckList, 0); mmioAscend(wma->hFile, &mmckList, 0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment