From 7b92d173003856978fce8d76f5889b35660d5e67 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 7 May 2017 16:33:10 +0300 Subject: [PATCH] Do not delay play status changes if caller does not use status callback functions. --- blkdev.cpp | 1 + blkdev_cdimage.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/blkdev.cpp b/blkdev.cpp index 8ec3676e..ec667ec3 100644 --- a/blkdev.cpp +++ b/blkdev.cpp @@ -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 diff --git a/blkdev_cdimage.cpp b/blkdev_cdimage.cpp index 2aa4bd51..8fd94f86 100644 --- a/blkdev_cdimage.cpp +++ b/blkdev_cdimage.cpp @@ -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; } -- 2.47.3