diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2014-03-03 12:42:14 +0100 |
---|---|---|
committer | Rainer Hochecker <fernetmenta@online.de> | 2014-03-03 20:26:53 +0100 |
commit | ba63a2b5440a23b97319f898afd8fce8792088bd (patch) | |
tree | 2a3deb1c0b360146c3cfc138e123426788c3f933 | |
parent | 1920d8dac57875dbcc5ff9dc0a15a4433d7d9c57 (diff) |
ActiveAE: increase max buffer size from 80ms to 100ms
-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; } } |