]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Do not delay play status changes if caller does not use status callback functions.
authorToni Wilen <twilen@winuae.net>
Sun, 7 May 2017 13:33:10 +0000 (16:33 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 7 May 2017 13:33:10 +0000 (16:33 +0300)
blkdev.cpp
blkdev_cdimage.cpp

index 8ec3676e67e2cb75576f0820ae3dfa57c6a10bf3..ec667ec33c40cb87704cb98c1640aa68ba03f64a 100644 (file)
@@ -808,6 +808,7 @@ int sys_command_cd_play (int unitnum, int startlsn, int endlsn, int scan, play_s
                return 0;
        if (!getsem (unitnum))
                return 0;
+       state[unitnum].play_end_pos = endlsn;
        if (state[unitnum].device_func->play == NULL)
                v = sys_command_cd_play (unitnum, startlsn, endlsn, scan);
        else
index 2aa4bd510395fdb6841b3c7d8090819855eafa58..8fd94f86f706dd94de0278248a3a91f67bfbd2cc 100644 (file)
@@ -778,7 +778,7 @@ static int command_play (int unitnum, int startlsn, int endlsn, int scan, play_s
        cdu->cdda_scan = scan > 0 ? 10 : (scan < 0 ? 10 : 0);
        cdu->cdda_delay = setstate (cdu, -1, -1);
        cdu->cdda_delay_frames = setstate (cdu, -2, -1);
-       setstate (cdu, AUDIO_STATUS_NOT_SUPPORTED, -1);
+       setstate (cdu, cdu->cdda_delay > 0 || cdu->cdda_delay_frames ? AUDIO_STATUS_NOT_SUPPORTED : AUDIO_STATUS_IN_PROGRESS, -1);
        if (!isaudiotrack (&cdu->di.toc, startlsn)) {
                setstate (cdu, AUDIO_STATUS_PLAY_ERROR, -1);
                return 0;
@@ -841,6 +841,9 @@ static int command_qcode (int unitnum, uae_u8 *buf, int sector, bool all)
                memcpy (p, subbuf + 12, 12);
        }
 
+       if (cdu->cdda_play_state == AUDIO_STATUS_PLAY_COMPLETE || cdu->cdda_play_state == AUDIO_STATUS_PLAY_ERROR)
+               cdu->cdda_play_state = AUDIO_STATUS_NO_STATUS;
+
        return 1;
 }