summaryrefslogtreecommitdiff
path: root/servers/audio
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-11-25 00:07:54 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-11-25 00:09:40 -0300
commitbc2e8d99e5ae0dbd69e712cc71da3033f5f30139 (patch)
treed836011e3d5873e3ceea328ea3100f3c7719ab99 /servers/audio
parent7dfba3cda9f13427f9f10a6eefbec52aef62274c (diff)
Made Vector::ptrw explicit for writing, compiler was sometimes using the wrong function,
leading to unnecesary copy on writes and reduced performance.
Diffstat (limited to 'servers/audio')
-rw-r--r--servers/audio/effects/audio_effect_chorus.cpp2
-rw-r--r--servers/audio/effects/audio_effect_delay.cpp4
-rw-r--r--servers/audio/effects/audio_effect_eq.cpp6
3 files changed, 6 insertions, 6 deletions
diff --git a/servers/audio/effects/audio_effect_chorus.cpp b/servers/audio/effects/audio_effect_chorus.cpp
index 32631beb2c..cfcad24bb3 100644
--- a/servers/audio/effects/audio_effect_chorus.cpp
+++ b/servers/audio/effects/audio_effect_chorus.cpp
@@ -68,7 +68,7 @@ void AudioEffectChorusInstance::_process_chunk(const AudioFrame *p_src_frames, A
unsigned int local_rb_pos = buffer_pos;
AudioFrame *dst_buff = p_dst_frames;
- AudioFrame *rb_buff = audio_buffer.ptr();
+ AudioFrame *rb_buff = audio_buffer.ptrw();
double delay_msec = v.delay;
unsigned int delay_frames = Math::fast_ftoi((delay_msec / 1000.0) * mix_rate);
diff --git a/servers/audio/effects/audio_effect_delay.cpp b/servers/audio/effects/audio_effect_delay.cpp
index b8a8603546..59b6a8da2a 100644
--- a/servers/audio/effects/audio_effect_delay.cpp
+++ b/servers/audio/effects/audio_effect_delay.cpp
@@ -82,8 +82,8 @@ void AudioEffectDelayInstance::_process_chunk(const AudioFrame *p_src_frames, Au
const AudioFrame *src = p_src_frames;
AudioFrame *dst = p_dst_frames;
- AudioFrame *rb_buf = ring_buffer.ptr();
- AudioFrame *fb_buf = feedback_buffer.ptr();
+ AudioFrame *rb_buf = ring_buffer.ptrw();
+ AudioFrame *fb_buf = feedback_buffer.ptrw();
for (int i = 0; i < p_frame_count; i++) {
diff --git a/servers/audio/effects/audio_effect_eq.cpp b/servers/audio/effects/audio_effect_eq.cpp
index 15905e3e0e..dc0e00e9a3 100644
--- a/servers/audio/effects/audio_effect_eq.cpp
+++ b/servers/audio/effects/audio_effect_eq.cpp
@@ -33,9 +33,9 @@
void AudioEffectEQInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) {
int band_count = bands[0].size();
- EQ::BandProcess *proc_l = bands[0].ptr();
- EQ::BandProcess *proc_r = bands[1].ptr();
- float *bgain = gains.ptr();
+ EQ::BandProcess *proc_l = bands[0].ptrw();
+ EQ::BandProcess *proc_r = bands[1].ptrw();
+ float *bgain = gains.ptrw();
for (int i = 0; i < band_count; i++) {
bgain[i] = Math::db2linear(base->gain[i]);
}