codec2: add smoothfactor when checking n-th work

pipeline watcher's queued work counter included smoothfactor, if we
don't add it in elapsed(), it is easy to cause CCodec queue call timeout

CRs-Fixed: 2984012
Test: Verified on OnePlus 9 that YouTube video does
      not unpause itself.
Change-Id: Ia2dbf3a7cf0da4805398cf44780ad3dacbaf1a1b
This commit is contained in:
Jiajia Cong 2021-08-05 16:33:35 +08:00 committed by Bartłomiej Rudecki
parent b780158cc9
commit c5c8a4a993

View file

@ -2720,7 +2720,7 @@ PipelineWatcher::Clock::duration CCodecBufferChannel::elapsed() {
size_t outputDelay = mOutput.lock()->outputDelay; size_t outputDelay = mOutput.lock()->outputDelay;
{ {
Mutexed<Input>::Locked input(mInput); Mutexed<Input>::Locked input(mInput);
n = input->inputDelay + input->pipelineDelay + outputDelay; n = input->inputDelay + input->pipelineDelay + outputDelay + kSmoothnessFactor;
} }
return mPipelineWatcher.lock()->elapsed(PipelineWatcher::Clock::now(), n); return mPipelineWatcher.lock()->elapsed(PipelineWatcher::Clock::now(), n);
} }