Przeglądaj źródła

Fix mono->stereo conversion for oggs (see #40630)

(cherry picked from commit f993d2eeee6d87309dd1b1da6b6beee0e1661f4e)
Ellen Poe 4 lat temu
rodzic
commit
fc0419d84a
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      modules/stb_vorbis/audio_stream_ogg_vorbis.cpp

+ 1 - 1
modules/stb_vorbis/audio_stream_ogg_vorbis.cpp

@@ -48,7 +48,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);
 		int mixed = stb_vorbis_get_samples_float_interleaved(ogg_stream, 2, buffer, todo * 2);
 		if (vorbis_stream->channels == 1 && mixed > 0) {
 		if (vorbis_stream->channels == 1 && mixed > 0) {
 			//mix mono to stereo
 			//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;
 				p_buffer[i].r = p_buffer[i].l;
 			}
 			}
 		}
 		}