Fix new stream types `mix()` not returning 0 when inactive
This commit is contained in:
parent
ff8a2780ee
commit
b22783b9b3
|
@ -858,10 +858,7 @@ int AudioStreamPlaybackInteractive::mix(AudioFrame *p_buffer, float p_rate_scale
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!active) {
|
if (!active) {
|
||||||
for (int i = 0; i < p_frames; i++) {
|
return 0;
|
||||||
p_buffer[i] = AudioFrame(0.0, 0.0);
|
|
||||||
}
|
|
||||||
return p_frames;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int todo = p_frames;
|
int todo = p_frames;
|
||||||
|
|
|
@ -259,10 +259,7 @@ void AudioStreamPlaybackPlaylist::seek(double p_time) {
|
||||||
|
|
||||||
int AudioStreamPlaybackPlaylist::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) {
|
int AudioStreamPlaybackPlaylist::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) {
|
||||||
if (!active) {
|
if (!active) {
|
||||||
for (int i = 0; i < p_frames; i++) {
|
return 0;
|
||||||
p_buffer[i] = AudioFrame(0.0, 0.0);
|
|
||||||
}
|
|
||||||
return p_frames;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double time_dec = (1.0 / AudioServer::get_singleton()->get_mix_rate());
|
double time_dec = (1.0 / AudioServer::get_singleton()->get_mix_rate());
|
||||||
|
|
|
@ -204,11 +204,8 @@ void AudioStreamPlaybackSynchronized::seek(double p_time) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int AudioStreamPlaybackSynchronized::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) {
|
int AudioStreamPlaybackSynchronized::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) {
|
||||||
if (active != true) {
|
if (!active) {
|
||||||
for (int i = 0; i < p_frames; i++) {
|
return 0;
|
||||||
p_buffer[i] = AudioFrame(0.0, 0.0);
|
|
||||||
}
|
|
||||||
return p_frames;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int todo = p_frames;
|
int todo = p_frames;
|
||||||
|
|
Loading…
Reference in New Issue