Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor bufer to buffer #12457

Merged
merged 1 commit into from Oct 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/opus/audio_stream_opus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void AudioStreamPlaybackOpus::seek(float p_time) {
frames_mixed = osrate * p_time;
}

int AudioStreamPlaybackOpus::mix(int16_t *p_bufer, int p_frames) {
int AudioStreamPlaybackOpus::mix(int16_t *p_buffer, int p_frames) {
if (!playing)
return 0;

Expand All @@ -281,7 +281,7 @@ int AudioStreamPlaybackOpus::mix(int16_t *p_bufer, int p_frames) {
break;
}

int ret = op_read(opus_file, (opus_int16 *)p_bufer, todo * stream_channels, &current_section);
int ret = op_read(opus_file, (opus_int16 *)p_buffer, todo * stream_channels, &current_section);
if (ret < 0) {
playing = false;
ERR_EXPLAIN("Error reading Opus File: " + file);
Expand Down Expand Up @@ -325,7 +325,7 @@ int AudioStreamPlaybackOpus::mix(int16_t *p_bufer, int p_frames) {

frames_mixed += ret;

p_bufer += ret * stream_channels;
p_buffer += ret * stream_channels;
p_frames -= ret;
}

Expand Down
2 changes: 1 addition & 1 deletion modules/opus/audio_stream_opus.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class AudioStreamPlaybackOpus : public AudioStreamPlayback {

virtual int get_minimum_buffer_size() const;

virtual int mix(int16_t *p_bufer, int p_frames);
virtual int mix(int16_t *p_buffer, int p_frames);

AudioStreamPlaybackOpus();
~AudioStreamPlaybackOpus();
Expand Down
8 changes: 4 additions & 4 deletions modules/vorbis/audio_stream_ogg_vorbis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ long AudioStreamPlaybackOGGVorbis::_ov_tell_func(void *_f) {
return fa->get_position();
}

int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_bufer, int p_frames) {
int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_buffer, int p_frames) {

if (!playing)
return 0;
Expand All @@ -109,9 +109,9 @@ int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_bufer, int p_frames) {
//printf("to mix %i - mix me %i bytes\n",to_mix,to_mix*stream_channels*sizeof(int16_t));

#ifdef BIG_ENDIAN_ENABLED
long ret = ov_read(&vf, (char *)p_bufer, todo * stream_channels * sizeof(int16_t), 1, 2, 1, &current_section);
long ret = ov_read(&vf, (char *)p_buffer, todo * stream_channels * sizeof(int16_t), 1, 2, 1, &current_section);
#else
long ret = ov_read(&vf, (char *)p_bufer, todo * stream_channels * sizeof(int16_t), 0, 2, 1, &current_section);
long ret = ov_read(&vf, (char *)p_buffer, todo * stream_channels * sizeof(int16_t), 0, 2, 1, &current_section);
#endif

if (ret < 0) {
Expand Down Expand Up @@ -162,7 +162,7 @@ int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_bufer, int p_frames) {

frames_mixed += ret;

p_bufer += ret * stream_channels;
p_buffer += ret * stream_channels;
p_frames -= ret;
}

Expand Down
2 changes: 1 addition & 1 deletion modules/vorbis/audio_stream_ogg_vorbis.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class AudioStreamPlaybackOGGVorbis : public AudioStreamPlayback {
virtual int get_mix_rate() const { return stream_srate; }

virtual int get_minimum_buffer_size() const { return 0; }
virtual int mix(int16_t *p_bufer, int p_frames);
virtual int mix(int16_t *p_buffer, int p_frames);

AudioStreamPlaybackOGGVorbis();
~AudioStreamPlaybackOGGVorbis();
Expand Down
2 changes: 1 addition & 1 deletion scene/resources/video_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class VideoStreamPlayback : public Resource {

virtual void set_audio_track(int p_idx) = 0;

//virtual int mix(int16_t* p_bufer,int p_frames)=0;
//virtual int mix(int16_t* p_buffer,int p_frames)=0;

virtual Ref<Texture> get_texture() = 0;
virtual void update(float p_delta) = 0;
Expand Down
6 changes: 3 additions & 3 deletions servers/audio/audio_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ void AudioStreamPlaybackRandomPitch::seek(float p_time) {
}
}

void AudioStreamPlaybackRandomPitch::mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames) {
void AudioStreamPlaybackRandomPitch::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) {
if (playing.is_valid()) {
playing->mix(p_bufer, p_rate_scale * pitch_scale, p_frames);
playing->mix(p_buffer, p_rate_scale * pitch_scale, p_frames);
} else {
for (int i = 0; i < p_frames; i++) {
p_bufer[i] = AudioFrame(0, 0);
p_buffer[i] = AudioFrame(0, 0);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions servers/audio/audio_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AudioStreamPlayback : public Reference {
virtual float get_playback_position() const = 0;
virtual void seek(float p_time) = 0;

virtual void mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames) = 0;
virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) = 0;

virtual float get_length() const = 0; //if supported, otherwise return 0
};
Expand All @@ -70,7 +70,7 @@ class AudioStreamPlaybackResampled : public AudioStreamPlayback {

protected:
void _begin_resample();
virtual void _mix_internal(AudioFrame *p_bufer, int p_frames) = 0;
virtual void _mix_internal(AudioFrame *p_buffer, int p_frames) = 0;
virtual float get_stream_sampling_rate() = 0;

public:
Expand Down Expand Up @@ -136,7 +136,7 @@ class AudioStreamPlaybackRandomPitch : public AudioStreamPlayback {
virtual float get_playback_position() const;
virtual void seek(float p_time);

virtual void mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames);
virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames);

virtual float get_length() const; //if supported, otherwise return 0

Expand Down
2 changes: 1 addition & 1 deletion servers/visual/visual_server_raster.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class VisualServerRaster : public VisualServer {
Set<Instance*> owned_instances;
BakedLightSampler *sampler;
int resolution;
Vector<Color> light_bufer;
Vector<Color> light_buffer;
RID sampled_light;
uint64_t last_pass;
Transform xform; // viewspace normal to lightspace, might not use one.
Expand Down