summaryrefslogtreecommitdiff
path: root/scene/audio/stream_player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/audio/stream_player.cpp')
-rw-r--r--scene/audio/stream_player.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp
index 74d84b8b08..f7cfc31b03 100644
--- a/scene/audio/stream_player.cpp
+++ b/scene/audio/stream_player.cpp
@@ -58,7 +58,7 @@ void StreamPlayer::sp_set_mix_rate(int p_rate){
bool StreamPlayer::sp_mix(int32_t *p_buffer,int p_frames) {
- if (resampler.is_ready()) {
+ if (resampler.is_ready() && !paused) {
return resampler.mix(p_buffer,p_frames);
}
@@ -170,6 +170,7 @@ void StreamPlayer::stop() {
stop_request=false;
playback->stop();
resampler.flush();
+ emit_signal("finished");
//set_idle_process(false);
}
@@ -378,6 +379,8 @@ void StreamPlayer::_bind_methods() {
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") );
ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") );
ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") );
+
+ ADD_SIGNAL(MethodInfo("finished"));
}