# HG changeset patch # User Sam Lantinga # Date 1001876876 0 # Node ID ddee60057806cd4eac416a14b286d988faeb11a6 # Parent ec77d3d322017f486185cbcc12fd839a96a8639d Fixed last track time calculation (thanks Tchi Southivong) diff -r ec77d3d32201 -r ddee60057806 src/cdrom/win32/SDL_syscdrom.c --- a/src/cdrom/win32/SDL_syscdrom.c Sun Sep 30 18:55:08 2001 +0000 +++ b/src/cdrom/win32/SDL_syscdrom.c Sun Sep 30 19:07:56 2001 +0000 @@ -215,18 +215,19 @@ } } if ( i == cdrom->numtracks ) { - flags &= ~MCI_TRACK; + mci_status.dwTrack = cdrom->track[i - 1].id; mci_status.dwItem = MCI_STATUS_LENGTH; if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, &mci_status) == 0 ) { - cdrom->track[i].offset = MSF_TO_FRAMES( + cdrom->track[i - 1].length = MSF_TO_FRAMES( MCI_MSF_MINUTE(mci_status.dwReturn), MCI_MSF_SECOND(mci_status.dwReturn), - MCI_MSF_FRAME(mci_status.dwReturn)); + MCI_MSF_FRAME(mci_status.dwReturn)) + 1; /* +1 to fix */ + /* MCI last track length bug */ + /* compute lead-out offset */ + cdrom->track[i].offset = cdrom->track[i - 1].offset + + cdrom->track[i - 1].length; cdrom->track[i].length = 0; - cdrom->track[i-1].length = - cdrom->track[i].offset- - cdrom->track[i-1].offset; okay = 1; } }