1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

[Editor] Move thread name assignment in audio preview

This method is not an instance method so cannot be used this way, it
instead sets the name of the *calling* thread. Putting it in the thread
function makes it work correctly.
This commit is contained in:
A Thousand Ships
2024-11-03 23:11:44 +01:00
parent 2d3bdcac35
commit 64fed07809

View File

@@ -109,6 +109,8 @@ void AudioStreamPreviewGenerator::_update_emit(ObjectID p_id) {
}
void AudioStreamPreviewGenerator::_preview_thread(void *p_preview) {
Thread::set_name("AudioStreamPreviewGenerator");
Preview *preview = static_cast<Preview *>(p_preview);
float muxbuff_chunk_s = 0.25;
@@ -208,7 +210,6 @@ 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);
}