From 7fda041a715ff2792de7cc6d789929b4682716d7 Mon Sep 17 00:00:00 2001 From: jjsat Date: Thu, 12 Dec 2013 19:15:07 +0100 Subject: [PATCH] Fix OGG speech ending prematurely if the audio file size is a multiple of the read buffer size (32786). This makes the engine correctly mark the last buffer to decode even if it has the same size as the read buffer. The MP3 case seems similar so the fix is applied there too. --- Engine/media/audio/clip_mymp3.cpp | 2 +- Engine/media/audio/clip_myogg.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/media/audio/clip_mymp3.cpp b/Engine/media/audio/clip_mymp3.cpp index 6cf9b29969..9546f32939 100644 --- a/Engine/media/audio/clip_mymp3.cpp +++ b/Engine/media/audio/clip_mymp3.cpp @@ -52,7 +52,7 @@ int MYMP3::poll() if (tempbuf != NULL) { int free_val = -1; - if (chunksize > in->todo) { + if (chunksize >= in->todo) { chunksize = in->todo; free_val = chunksize; } diff --git a/Engine/media/audio/clip_myogg.cpp b/Engine/media/audio/clip_myogg.cpp index 839155e5e6..4a9e8b3d8d 100644 --- a/Engine/media/audio/clip_myogg.cpp +++ b/Engine/media/audio/clip_myogg.cpp @@ -55,7 +55,7 @@ int MYOGG::poll() if (tempbuf != NULL) { int free_val = -1; - if (chunksize > in->todo) + if (chunksize >= in->todo) { chunksize = in->todo; free_val = chunksize;