2012-06-09, 15:56
From DVDPlayerAudio.cpp ln780:
Basically every time the error exceeds the threshold (and it would normally resample or skip or duplicate the audio packet here depending on the setting) if on videoclock or drop the frame if on the default audioclock, it instead just resets the accumulated error to zero. It all depends on the file a/v interleave what happens thereafter, i.e. if error continues to accumulate or a syncframe corrects it.
Code:
else if (m_synctype == SYNC_RESAMPLE)
{
//reset the integral on big errors, failsafe
if (fabs(m_error) > DVD_TIME_BASE)
m_integral = 0;
else if (fabs(m_error) > DVD_MSEC_TO_TIME(5))
m_integral += m_error / DVD_TIME_BASE / INTEGRAL;
Basically every time the error exceeds the threshold (and it would normally resample or skip or duplicate the audio packet here depending on the setting) if on videoclock or drop the frame if on the default audioclock, it instead just resets the accumulated error to zero. It all depends on the file a/v interleave what happens thereafter, i.e. if error continues to accumulate or a syncframe corrects it.