Merge pull request #36742 from bruce965/loop-ogg-audio

Fix OGG audio loops
This commit is contained in:
Rémi Verschelde 2020-03-03 10:29:38 +01:00 committed by GitHub
commit 3c7d92c590
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,7 +57,8 @@ void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_fra
if (todo) {
//end of file!
if (vorbis_stream->loop && mixed > 0) {
bool is_not_empty = mixed > 0 || stb_vorbis_stream_length_in_samples(ogg_stream) > 0;
if (vorbis_stream->loop && is_not_empty) {
//loop
seek(vorbis_stream->loop_offset);
loops++;