aboutsummaryrefslogtreecommitdiff
path: root/morphos/morphos_sound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'morphos/morphos_sound.cpp')
-rw-r--r--morphos/morphos_sound.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/morphos/morphos_sound.cpp b/morphos/morphos_sound.cpp
index 17add88953..4077561ad7 100644
--- a/morphos/morphos_sound.cpp
+++ b/morphos/morphos_sound.cpp
@@ -210,14 +210,7 @@ int morphos_music_thread( Scumm *s, ULONG MidiUnit, bool NoMusic )
for(;;)
{
if( CheckSignal( SIGBREAKF_CTRL_F ) )
- {
- if( ahiReqSent[ ahiCurBuf ] )
- {
- AbortIO( (struct IORequest *)ahiReq[ ahiCurBuf ] );
- WaitIO ( (struct IORequest *)ahiReq[ ahiCurBuf ] );
- }
break;
- }
if( !snd_driv.wave_based() )
{
@@ -248,7 +241,10 @@ int morphos_music_thread( Scumm *s, ULONG MidiUnit, bool NoMusic )
UWORD ahiOtherBuf = !ahiCurBuf;
if( ahiReqSent[ ahiCurBuf ] )
+ {
WaitIO( (struct IORequest *)req );
+ ahiReqSent[ ahiCurBuf ] = FALSE;
+ }
if( CheckSignal( SIGBREAKF_CTRL_F ) )
break;
@@ -272,6 +268,12 @@ int morphos_music_thread( Scumm *s, ULONG MidiUnit, bool NoMusic )
}
}
+ if( ahiReqSent[ ahiCurBuf ] )
+ {
+ AbortIO( (struct IORequest *)ahiReq[ ahiCurBuf ] );
+ WaitIO ( (struct IORequest *)ahiReq[ ahiCurBuf ] );
+ }
+
if( TimerAvailable )
{
CloseDevice( (struct IORequest *)TimerIORequest );