Fix issue 15895, audio streams don't signalling finished after the first one

if the audio player is set to play again due to the order of calls in
_notification. First it emits the signal, and later it disable the internal
processing regardless what the callback did.

Changed to emit the signal at the end to ensure the changes done at callback
remains.

(cherry picked from commit d588fe2740)
This commit is contained in:
robfram 2018-01-20 22:22:00 +01:00 committed by Hein-Pieter van Braam
parent e44bef4404
commit 1036a76bc5
1 changed files with 1 additions and 1 deletions

View File

@ -126,8 +126,8 @@ void AudioStreamPlayer::_notification(int p_what) {
if (!active || (setseek < 0 && !stream_playback->is_playing())) { if (!active || (setseek < 0 && !stream_playback->is_playing())) {
active = false; active = false;
emit_signal("finished");
set_process_internal(false); set_process_internal(false);
emit_signal("finished");
} }
} }