PATCH: Fixes some problems with the CD-ROM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

This should fix some bizzare problems with the MCI access to the CD-ROM which would often result in playing the wrong track or not playing at all. Please note that the Windows cdplayer is still not working at this time for not detecting any audible tracks.

Apparently the present problem was due to a wrong address formatting by the cdrom driver's ReadTOC function, which is addressed by this patch.

Enjoy,
Waldeck

Index: wine/dlls/ntdll/cdrom.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/cdrom.c,v
retrieving revision 1.24
diff -u -p -r1.24 cdrom.c
--- wine/dlls/ntdll/cdrom.c	23 Jan 2003 21:32:36 -0000	1.24
+++ wine/dlls/ntdll/cdrom.c	27 Jan 2003 08:58:25 -0000
@@ -482,10 +482,10 @@ static DWORD CDROM_ReadTOC(int dev, CDRO
         toc->TrackData[i - toc->FirstTrack].Adr = entry.cdte_adr;
         /* marking last track with leadout value as index */
         toc->TrackData[i - toc->FirstTrack].TrackNumber = entry.cdte_track;
-        toc->TrackData[i - toc->FirstTrack].Address[0] = 0;
-        toc->TrackData[i - toc->FirstTrack].Address[1] = entry.cdte_addr.msf.minute;
-        toc->TrackData[i - toc->FirstTrack].Address[2] = entry.cdte_addr.msf.second;
-        toc->TrackData[i - toc->FirstTrack].Address[3] = entry.cdte_addr.msf.frame;
+        toc->TrackData[i - toc->FirstTrack].Address[3] = 0;
+        toc->TrackData[i - toc->FirstTrack].Address[0] = entry.cdte_addr.msf.minute;
+        toc->TrackData[i - toc->FirstTrack].Address[1] = entry.cdte_addr.msf.second;
+        toc->TrackData[i - toc->FirstTrack].Address[2] = entry.cdte_addr.msf.frame;
     }
 end:
     ret = CDROM_GetStatusCode(io);
@@ -528,10 +528,10 @@ end:
         toc->TrackData[i - toc->FirstTrack].Adr = toc_buffer.addr_type;
         /* marking last track with leadout value as index */
         toc->TrackData[i - toc->FirstTrack].TrackNumber = entry.starting_track;
-        toc->TrackData[i - toc->FirstTrack].Address[0] = 0;
-        toc->TrackData[i - toc->FirstTrack].Address[1] = toc_buffer.addr.msf.minute;
-        toc->TrackData[i - toc->FirstTrack].Address[2] = toc_buffer.addr.msf.second;
-        toc->TrackData[i - toc->FirstTrack].Address[3] = toc_buffer.addr.msf.frame;
+        toc->TrackData[i - toc->FirstTrack].Address[3] = 0;
+        toc->TrackData[i - toc->FirstTrack].Address[0] = toc_buffer.addr.msf.minute;
+        toc->TrackData[i - toc->FirstTrack].Address[1] = toc_buffer.addr.msf.second;
+        toc->TrackData[i - toc->FirstTrack].Address[2] = toc_buffer.addr.msf.frame;
     }
 end:
     ret = CDROM_GetStatusCode(io);
@@ -555,7 +555,7 @@ static DWORD CDROM_GetDiskData(int dev, 
     if ((ret = CDROM_ReadTOC(dev, &toc)) != 0) return ret;
     data->DiskData = 0;
     for (i = toc.FirstTrack; i <= toc.LastTrack; i++) {
-        if (toc.TrackData[i].Control & 0x04)
+        if (toc.TrackData[i-toc.FirstTrack].Control & 0x04)
             data->DiskData |= CDROM_DISK_DATA_TRACK;
         else
             data->DiskData |= CDROM_DISK_AUDIO_TRACK;

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux