Merge pull request #46083 from ellenhp/mono_ogg_fix

Fix mono->stereo conversion for oggs
This commit is contained in:
Rémi Verschelde 2021-02-16 10:50:10 +01:00 committed by GitHub
commit b196e62709
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,7 +47,7 @@ void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_fra
int mixed = stb_vorbis_get_samples_float_interleaved(ogg_stream, 2, buffer, todo * 2);
if (vorbis_stream->channels == 1 && mixed > 0) {
//mix mono to stereo
for (int i = start_buffer; i < mixed; i++) {
for (int i = start_buffer; i < start_buffer + mixed; i++) {
p_buffer[i].r = p_buffer[i].l;
}
}