From 4807fdb4c70bd21c412914089b493cc190c50fb5 Mon Sep 17 00:00:00 2001 From: Yotam Barnoy Date: Thu, 23 Sep 2010 21:03:20 +0000 Subject: PSP: fix issue in ME MP3 code. Release and init the ME when seeking. Without this fix, the ME allocates more and more memory with every seek until it can't work. svn-id: r52868 --- backends/platform/psp/mp3.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'backends') diff --git a/backends/platform/psp/mp3.cpp b/backends/platform/psp/mp3.cpp index 98e8a0404b..da189c532c 100644 --- a/backends/platform/psp/mp3.cpp +++ b/backends/platform/psp/mp3.cpp @@ -415,10 +415,13 @@ bool Mp3PspStream::seek(const Timestamp &where) { mad_timer_t destination; mad_timer_set(&destination, time / 1000, time % 1000, 1000); + // Important to release and re-init the ME + releaseStreamME(); + initStreamME(); + // Check if we need to rewind if (_state != MP3_STATE_READY || mad_timer_compare(destination, _totalTime) < 0) { initStream(); - initStreamME(); } // Skip ahead -- cgit v1.2.3