Commit b4b9303e authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Fixed first/last playable frame referencing.

parent f919cf3a
......@@ -30,17 +30,21 @@ typedef struct {
#elif defined(__FreeBSD__) || defined(__NetBSD__)
struct cd_sub_channel_info sc;
#endif
int cdaMode;
UINT16 nCurTrack;
DWORD dwCurFrame;
/* those data reflect the cdaudio structure and
* don't change while playing
*/
UINT16 nTracks;
UINT16 nFirstTrack;
UINT16 nLastTrack;
DWORD dwTotalLen;
LPDWORD lpdwTrackLen;
LPDWORD lpdwTrackPos;
LPBYTE lpbTrackFlags;
DWORD dwFirstOffset;
DWORD dwFirstFrame;
DWORD dwLastFrame;
/* those data change while playing */
int cdaMode;
UINT16 nCurTrack;
DWORD dwCurFrame;
} WINE_CDAUDIO;
#define WINE_CDA_DONTKNOW 0x00
......
......@@ -39,8 +39,8 @@ int CDAUDIO_Open(WINE_CDAUDIO* wcda)
wcda->cdaMode = WINE_CDA_OPEN; /* to force reading tracks info */
wcda->nCurTrack = 0;
wcda->nTracks = 0;
wcda->dwTotalLen = 0;
wcda->dwFirstOffset = 0;
wcda->dwFirstFrame = 0;
wcda->dwLastFrame = 0;
wcda->lpdwTrackLen = NULL;
wcda->lpdwTrackPos = NULL;
wcda->lpbTrackFlags = NULL;
......@@ -152,7 +152,7 @@ BOOL CDAUDIO_GetTracksInfo(WINE_CDAUDIO* wcda)
#endif
else
#ifdef linux
entry.cdte_track = i + 1;
entry.cdte_track = i + 1;
#else
entry.starting_track = i + 1;
#endif
......@@ -187,7 +187,7 @@ BOOL CDAUDIO_GetTracksInfo(WINE_CDAUDIO* wcda)
#endif
if (i == 0) {
last_start = start;
wcda->dwFirstOffset = start;
wcda->dwFirstFrame = start;
TRACE("dwFirstOffset=%u\n", start);
} else {
length = start - last_start;
......@@ -207,7 +207,7 @@ BOOL CDAUDIO_GetTracksInfo(WINE_CDAUDIO* wcda)
#endif
TRACE("track #%u flags=%02x\n", i + 1, wcda->lpbTrackFlags[i]);
}
wcda->dwTotalLen = total_length;
wcda->dwLastFrame = last_start;
TRACE("total_len=%u\n", total_length);
return TRUE;
#else
......@@ -425,6 +425,9 @@ int CDAUDIO_Pause(WINE_CDAUDIO* wcda, int pauseOn)
#endif
}
/**************************************************************************
* CDAUDIO_Seek [internal]
*/
int CDAUDIO_Seek(WINE_CDAUDIO* wcda, DWORD at)
{
#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
......@@ -435,7 +438,7 @@ int CDAUDIO_Seek(WINE_CDAUDIO* wcda, DWORD at)
msf.second = (at % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
msf.frame = at % CDFRAMES_PERSEC;
ret = ioctl(wcda->unixdev, CDROMSEEK, &msf);
ret = ioctl(wcda->unixdev, CDROMSEEK, &msf);
#else
/* FIXME: the current end for play is lost
* use end of CD ROM instead
......
......@@ -620,7 +620,7 @@ static void MSCDEX_Handler(CONTEXT86* context)
break;
case 8: /* Volume size */
PTR_AT(io_stru, 1, DWORD) = wcda.dwTotalLen;
PTR_AT(io_stru, 1, DWORD) = wcda.dwLastFrame;
TRACE(" ----> VOLUME SIZE <%ld>\n", PTR_AT(io_stru, 1, DWORD));
break;
......@@ -633,7 +633,7 @@ static void MSCDEX_Handler(CONTEXT86* context)
case 10: /* audio disk info */
io_stru[1] = wcda.nFirstTrack; /* starting track of the disc */
io_stru[2] = wcda.nLastTrack; /* ending track */
MSCDEX_StoreMSF(wcda.dwTotalLen, io_stru + 3);
MSCDEX_StoreMSF(wcda.dwLastFrame, io_stru + 3);
TRACE(" ----> AUDIO DISK INFO <%d-%d/%08lx>\n",
io_stru[1], io_stru[2], PTR_AT(io_stru, 3, DWORD));
......
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