summaryrefslogtreecommitdiff
path: root/editor/audio_stream_preview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/audio_stream_preview.cpp')
-rw-r--r--editor/audio_stream_preview.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/audio_stream_preview.cpp b/editor/audio_stream_preview.cpp
index bea95d873e..b9e52ad7ad 100644
--- a/editor/audio_stream_preview.cpp
+++ b/editor/audio_stream_preview.cpp
@@ -153,6 +153,8 @@ void AudioStreamPreviewGenerator::_preview_thread(void *p_preview) {
singleton->call_deferred(SNAME("_update_emit"), preview->id);
}
+ preview->preview->version++;
+
preview->playback->stop();
preview->generating.clear();
@@ -171,7 +173,7 @@ Ref<AudioStreamPreview> AudioStreamPreviewGenerator::generate_preview(const Ref<
Preview *preview = &previews[p_stream->get_instance_id()];
preview->base_stream = p_stream;
- preview->playback = preview->base_stream->instance_playback();
+ preview->playback = preview->base_stream->instantiate_playback();
preview->generating.set();
preview->id = p_stream->get_instance_id();
@@ -198,6 +200,7 @@ Ref<AudioStreamPreview> AudioStreamPreviewGenerator::generate_preview(const Ref<
if (preview->playback.is_valid()) {
preview->thread = memnew(Thread);
+ preview->thread->set_name("AudioStreamPreviewGenerator");
preview->thread->start(_preview_thread, preview);
}