diff options
-rw-r--r-- | xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp index 786a489d4c..02c0a34fe2 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp @@ -32,6 +32,7 @@ using namespace ActiveAE; #define MAX_CACHE_LEVEL 0.5 // total cache time of stream in seconds #define MAX_WATER_LEVEL 0.25 // buffered time after stream stages in seconds +#define MAX_BUFFER_TIME 0.1 // max time of a buffer in seconds void CEngineStats::Reset(unsigned int sampleRate) { @@ -942,11 +943,11 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt) m_sink.m_controlPort.SendOutMessage(CSinkControlProtocol::VOLUME, &m_volume, sizeof(float)); // limit buffer size in case of sink returns large buffer - unsigned int buffertime = (m_sinkFormat.m_frames*1000) / m_sinkFormat.m_sampleRate; - if (buffertime > 80) + unsigned int buffertime = m_sinkFormat.m_frames / m_sinkFormat.m_sampleRate; + if (buffertime > MAX_BUFFER_TIME) { - CLog::Log(LOGWARNING, "ActiveAE::%s - sink returned large buffer of %d ms, reducing to 80 ms", __FUNCTION__, buffertime); - m_sinkFormat.m_frames = 80 * m_sinkFormat.m_sampleRate / 1000; + CLog::Log(LOGWARNING, "ActiveAE::%s - sink returned large buffer of %d ms, reducing to %d ms", __FUNCTION__, buffertime, MAX_BUFFER_TIME*1000); + m_sinkFormat.m_frames = MAX_BUFFER_TIME * m_sinkFormat.m_sampleRate; } } |