Merge pull request #55808 from ellenhp/fix_ogg_is_playing

Fix OGG streams never ending playback
This commit is contained in:
Rémi Verschelde 2021-12-11 08:54:45 +01:00 committed by GitHub
commit 092a286127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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) {