diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-03-03 10:29:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-03 10:29:38 +0100 |
commit | 3c7d92c590f48ea9a265ec20d7af43a3aa44632f (patch) | |
tree | 28effdd77b155858132f0cbef489b0e3f9eacbf7 | |
parent | c9768f15f7bb194622b9020ab2614d47ac7e63dd (diff) | |
parent | 4f8d1c47b8d8c0429c4499ead764850324a77ed3 (diff) |
Merge pull request #36742 from bruce965/loop-ogg-audio
Fix OGG audio loops
-rw-r--r-- | modules/stb_vorbis/audio_stream_ogg_vorbis.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index 054ed088df..42f341cef7 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -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++; |