Skip to content

Commit 9cbf543

Browse files
committed
Only call idle() when the last stream closes
1 parent 6d61ee1 commit 9cbf543

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/synthDrivers/sapi5.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ def EndStream(self, streamNum: int, pos: int):
201201
synth.sonicStream.flush()
202202
audioData = synth.sonicStream.readShort()
203203
synth.player.feed(audioData, len(audioData) * 2)
204-
synth.player.idle()
204+
if len(synth._streamBookmarks) == 1:
205+
# This is the last closing stream. Safe to call idle().
206+
synth.player.idle()
205207
# trigger all untriggered bookmarks
206208
if streamNum in synth._streamBookmarks:
207209
for bookmark in synth._streamBookmarks[streamNum]:

0 commit comments

Comments
 (0)