cdrom: read subq directly, not from thread
authornotaz <notasas@gmail.com>
Sat, 3 Nov 2012 20:06:31 +0000 (22:06 +0200)
committernotaz <notasas@gmail.com>
Sat, 3 Nov 2012 20:06:31 +0000 (22:06 +0200)
thread is doing 10 sectors at once, not that accurate..

libpcsxcore/cdriso.c
libpcsxcore/cdrom.c

index 0089cfe..8a631f4 100644 (file)
@@ -185,13 +185,6 @@ static void *playthread(void *param)
                        cdda_cur_sector++;
                }
 
-               if (subHandle != NULL) {
-                       fseek(subHandle, cdda_cur_sector * SUB_FRAMESIZE, SEEK_SET);
-                       fread(subbuffer, 1, SUB_FRAMESIZE, subHandle);
-
-                       if (subChanRaw) DecodeRawSubData();
-               }
-
                if (s == 0) {
                        playing = FALSE;
                        initial_offset = 0;
index 297c8ae..afacad2 100644 (file)
@@ -541,6 +541,9 @@ static void cdrPlayInterrupt_Autopause()
        struct SubQ *subq = (struct SubQ *)CDR_getBufferSub();
        int track_changed = 0;
        if (subq != NULL ) {
+               // update subq
+               ReadTrack( cdr.SetSectorPlay );
+
 #ifdef CDR_LOG
                CDR_LOG( "CDDA SUB - %X:%X:%X\n",
                        subq->AbsoluteAddress[0], subq->AbsoluteAddress[1], subq->AbsoluteAddress[2] );
@@ -958,6 +961,9 @@ void cdrInterrupt() {
                        subq = (struct SubQ *)CDR_getBufferSub();
 
                        if (subq != NULL) {
+                               // update subq
+                               ReadTrack( cdr.SetSectorPlay );
+
                                cdr.Result[0] = subq->TrackNumber;
                                cdr.Result[1] = subq->IndexNumber;
                                memcpy(cdr.Result + 2, subq->TrackRelativeAddress, 3);