From 16245f2c2942de62f8b123269749272731cfd5fb Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 27 Mar 2020 16:14:19 -0300 Subject: Remove the audio memory allocator, use regular one instead. --- modules/stb_vorbis/audio_stream_ogg_vorbis.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index 42f341cef7..e5d0e0b12d 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -122,7 +122,7 @@ void AudioStreamPlaybackOGGVorbis::seek(float p_time) { AudioStreamPlaybackOGGVorbis::~AudioStreamPlaybackOGGVorbis() { if (ogg_alloc.alloc_buffer) { stb_vorbis_close(ogg_stream); - AudioServer::get_singleton()->audio_data_free(ogg_alloc.alloc_buffer); + memfree(ogg_alloc.alloc_buffer); } } @@ -134,7 +134,7 @@ Ref AudioStreamOGGVorbis::instance_playback() { ovs.instance(); ovs->vorbis_stream = Ref(this); - ovs->ogg_alloc.alloc_buffer = (char *)AudioServer::get_singleton()->audio_data_alloc(decode_mem_size); + ovs->ogg_alloc.alloc_buffer = (char *)memalloc(decode_mem_size); ovs->ogg_alloc.alloc_buffer_length_in_bytes = decode_mem_size; ovs->frames_mixed = 0; ovs->active = false; @@ -143,7 +143,7 @@ Ref AudioStreamOGGVorbis::instance_playback() { ovs->ogg_stream = stb_vorbis_open_memory((const unsigned char *)data, data_len, &error, &ovs->ogg_alloc); if (!ovs->ogg_stream) { - AudioServer::get_singleton()->audio_data_free(ovs->ogg_alloc.alloc_buffer); + memfree(ovs->ogg_alloc.alloc_buffer); ovs->ogg_alloc.alloc_buffer = NULL; ERR_FAIL_COND_V(!ovs->ogg_stream, Ref()); } @@ -158,7 +158,7 @@ String AudioStreamOGGVorbis::get_stream_name() const { void AudioStreamOGGVorbis::clear_data() { if (data) { - AudioServer::get_singleton()->audio_data_free(data); + memfree(data); data = NULL; data_len = 0; } @@ -210,7 +210,8 @@ void AudioStreamOGGVorbis::set_data(const Vector &p_data) { // free any existing data clear_data(); - data = AudioServer::get_singleton()->audio_data_alloc(src_data_len, src_datar); + data = memalloc(src_data_len); + copymem(data, src_datar, src_data_len); data_len = src_data_len; break; -- cgit v1.2.3