aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspiff <spiff@xbmc.org>2011-11-14 17:24:09 +0100
committerspiff <spiff@xbmc.org>2011-11-14 17:24:09 +0100
commit9db3f643c6f8c515ffd39b7ab70e49f6012fb48a (patch)
tree9d06dbf3152396f531a8bb438490f8c89288c038
parentb76bab8e3d3743ba691b801abcc088f1af2940a5 (diff)
fixed: mp3 files with > 8k crap on start didn't work.
we now read up to 5*8k before we bail. closes #12210
-rw-r--r--xbmc/cores/paplayer/MP3codec.cpp4
-rw-r--r--xbmc/cores/paplayer/MP3codec.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/xbmc/cores/paplayer/MP3codec.cpp b/xbmc/cores/paplayer/MP3codec.cpp
index 0fdf1caa37..c03ebb0707 100644
--- a/xbmc/cores/paplayer/MP3codec.cpp
+++ b/xbmc/cores/paplayer/MP3codec.cpp
@@ -106,6 +106,7 @@ bool MP3Codec::Init(const CStdString &strFile, unsigned int filecache)
m_lastByteOffset = 0;
m_eof = false;
m_CallAgainWithSameBuffer = false;
+ m_readRetries = 5;
CFileItem item(strFile, false);
CMusicInfoTagLoaderMP3 mp3info;
@@ -268,6 +269,8 @@ int MP3Codec::Read(int size, bool init)
{
if (init)
{
+ if (result == 0 && m_readRetries-- > 0)
+ return Read(size,init);
// Make sure some data was decoded. Without a valid frame, we cannot determine the audio format
if (!outputsize)
return DECODING_ERROR;
@@ -327,6 +330,7 @@ int MP3Codec::Read(int size, bool init)
return result;
}
}
+ m_readRetries = 5;
return DECODING_SUCCESS;
}
diff --git a/xbmc/cores/paplayer/MP3codec.h b/xbmc/cores/paplayer/MP3codec.h
index 3c97dc2fd8..268b4a9857 100644
--- a/xbmc/cores/paplayer/MP3codec.h
+++ b/xbmc/cores/paplayer/MP3codec.h
@@ -95,6 +95,7 @@ private:
bool m_eof;
bool m_Decoding;
bool m_CallAgainWithSameBuffer;
+ int m_readRetries;
// Input buffer to read our mp3 data into
BYTE* m_InputBuffer;