From fe51c099c1a0995b6392d48e42844cfe4b0138b6 Mon Sep 17 00:00:00 2001 From: Ellen Poe Date: Fri, 10 Dec 2021 18:09:58 -0800 Subject: [PATCH] Fix OGG streams never ending playback --- modules/vorbis/audio_stream_ogg_vorbis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index d913c115d94..06ed021a5a1 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -56,7 +56,7 @@ int AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_fram todo -= mixed; frames_mixed += mixed; start_buffer += mixed; - if (!have_packets_left) { + if (!have_packets_left && !have_samples_left) { //end of file! bool is_not_empty = mixed > 0 || vorbis_stream->get_length() > 0; if (vorbis_stream->loop && is_not_empty) {