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