Skip to content

Commit

Permalink
ActiveAE: limit buffertime to 80ms
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta committed Dec 8, 2013
1 parent 6caeb83 commit 07f238c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,14 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt)
initSink = true;
m_stats.Reset(m_sinkFormat.m_sampleRate);
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)
{
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;
}
}

if (m_silenceBuffers)
Expand Down

0 comments on commit 07f238c

Please sign in to comment.