diff options
Diffstat (limited to 'servers/audio/audio_rb_resampler.h')
-rw-r--r-- | servers/audio/audio_rb_resampler.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/servers/audio/audio_rb_resampler.h b/servers/audio/audio_rb_resampler.h index 40cf3e4cd7..12ec526adb 100644 --- a/servers/audio/audio_rb_resampler.h +++ b/servers/audio/audio_rb_resampler.h @@ -36,7 +36,6 @@ #include "servers/audio_server.h" struct AudioRBResampler { - uint32_t rb_bits; uint32_t rb_len; uint32_t rb_mask; @@ -116,31 +115,24 @@ public: _FORCE_INLINE_ float *get_write_buffer() { return read_buf; } _FORCE_INLINE_ void write(uint32_t p_frames) { - ERR_FAIL_COND(p_frames >= rb_len); switch (channels) { case 1: { - for (uint32_t i = 0; i < p_frames; i++) { - rb[rb_write_pos] = read_buf[i]; rb_write_pos = (rb_write_pos + 1) & rb_mask; } } break; case 2: { - for (uint32_t i = 0; i < p_frames; i++) { - rb[(rb_write_pos << 1) + 0] = read_buf[(i << 1) + 0]; rb[(rb_write_pos << 1) + 1] = read_buf[(i << 1) + 1]; rb_write_pos = (rb_write_pos + 1) & rb_mask; } } break; case 4: { - for (uint32_t i = 0; i < p_frames; i++) { - rb[(rb_write_pos << 2) + 0] = read_buf[(i << 2) + 0]; rb[(rb_write_pos << 2) + 1] = read_buf[(i << 2) + 1]; rb[(rb_write_pos << 2) + 2] = read_buf[(i << 2) + 2]; @@ -149,9 +141,7 @@ public: } } break; case 6: { - for (uint32_t i = 0; i < p_frames; i++) { - rb[(rb_write_pos * 6) + 0] = read_buf[(i * 6) + 0]; rb[(rb_write_pos * 6) + 1] = read_buf[(i * 6) + 1]; rb[(rb_write_pos * 6) + 2] = read_buf[(i * 6) + 2]; |