Skip to content
Snippets Groups Projects
Commit aad78b91 authored by James Abbatiello's avatar James Abbatiello Committed by Alexandre Julliard
Browse files

MCI_STATUS_LENGTH on Windows returns one frame less than the total

track length for the last track on a CD.  This also affects queries
for the total length of the CD.
parent ab170a9c
No related branches found
No related tags found
No related merge requests found
......@@ -440,8 +440,15 @@ static DWORD MCICDA_Status(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParm
if (lpParms->dwTrack > wmcda->wcda.nTracks || lpParms->dwTrack == 0)
return MCIERR_OUTOFRANGE;
lpParms->dwReturn = wmcda->wcda.lpdwTrackLen[lpParms->dwTrack - 1];
/* Windows returns one frame less than the total track length for the
last track on the CD. See CDDB HOWTO. Verified on Win95OSR2. */
if (lpParms->dwTrack == wmcda->wcda.nTracks)
lpParms->dwReturn--;
} else {
lpParms->dwReturn = wmcda->wcda.dwLastFrame;
/* Sum of the lengths of all of the tracks. Inherits the
'off by one frame' behavior from the length of the last track.
See above comment. */
lpParms->dwReturn = wmcda->wcda.dwLastFrame - wmcda->wcda.dwFirstFrame - 1;
}
lpParms->dwReturn = MCICDA_CalcTime(wmcda,
(wmcda->dwTimeFormat == MCI_FORMAT_TMSF)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment