Skip to content

Commit

Permalink
MP1-5177: WASAPI rendererer: Early sample check fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
epbk committed Oct 27, 2023
1 parent 72d50fb commit 16aea06
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ HRESULT CWASAPIRenderFilter::CheckStreamTimeline(IMediaSample* pSample, REFERENC

return MPAR_S_DROP_SAMPLE;
}
else if ((m_nSampleNum == 0 && *pDueTime > rtHWTime) || resync)
else if ((m_nSampleNum == 0 && *pDueTime > rtHWTime) || (m_nSampleNum <= 20 && (*pDueTime - rtHWTime) > 150000) || resync)
{
m_nSampleNum++;

Expand Down Expand Up @@ -580,6 +580,8 @@ void CWASAPIRenderFilter::UpdateAudioClock()
Log("UpdateAudioClock: prevPos: %6.3f > ullHwClock: %6.3f diff: %6.3f QPC diff: %6.3f m_llPosError: %6.3f correction: %6.3f",
m_ullPrevPos / 10000000.0, ullHwClock / 10000000.0, (m_ullPrevPos - ullHwClock) / 10000000.0, (qpc - m_ullPrevQpc) / 10000000.0,
m_llPosError / 10000000.0, correction / 10000000.0);

m_nSampleNum = 0;
}

m_ullPrevPos = ullHwClock;
Expand Down Expand Up @@ -841,6 +843,7 @@ DWORD CWASAPIRenderFilter::ThreadProc()
{
sampleProcessed = false;
writeSilence = 0;
m_nSampleNum = 0;
m_state = StateRunning;
if (!m_pCurrentSample)
{
Expand Down

0 comments on commit 16aea06

Please sign in to comment.