Skip to content

Commit

Permalink
Merge pull request xbmc#6971 from FernetMenta/sync4
Browse files Browse the repository at this point in the history
dvdplayer: reduce time for initial audio sync
  • Loading branch information
FernetMenta committed Apr 20, 2015
2 parents a844e08 + fd54f90 commit c7e1789
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ void CDVDPlayerAudio::HandleSyncError(double duration)
// error because drop/dupe changes the value
if (m_syncclock && fabs(error) > threshold1)
{
m_errors.Flush(500);
m_errors.Flush();
m_integral = 0.0;
m_resampleratio = 0.0;
return;
Expand All @@ -684,13 +684,13 @@ void CDVDPlayerAudio::HandleSyncError(double duration)
// 500ms in order to get first resample ratio early. If we don't adjust rr early, error
// may get above threshold1 again. Too small values for interval result in worse average errors

if (!m_errors.Get(m_error, m_syncclock ? 500 : 2000))
if (!m_errors.Get(m_error, m_syncclock ? 100 : 2000))
return;

if (fabs(m_error) > threshold1)
{
m_syncclock = true;
m_errors.Flush(500);
m_errors.Flush(100);
m_integral = 0.0;
m_resampleratio = 0.0;
CLog::Log(LOGDEBUG,"CDVDPlayerAudio::HandleSyncError - average error %f above threshold of %f",
Expand Down
4 changes: 2 additions & 2 deletions xbmc/cores/dvdplayer/DVDPlayerAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class CDVDErrorAverage
m_count++;
}

void Flush(int interval = 500)
void Flush(int interval = 100)
{
m_buffer = 0.0f;
m_count = 0;
Expand All @@ -84,7 +84,7 @@ class CDVDErrorAverage
return 0.0;
}

bool Get(double& error, int interval = 500)
bool Get(double& error, int interval = 100)
{
if(m_timer.IsTimePast())
{
Expand Down

0 comments on commit c7e1789

Please sign in to comment.