Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3b87a536 authored by Shrikara B's avatar Shrikara B Committed by Malathi Gottam
Browse files

CCodec: Update watchdog to handle timeouts accurately

Update initiateReleaseIfStuck function to decide timeout just before
calling onError.
This avoids some cases where an event (e.g., configure)
is decided as timed out by this thread immediately after function
entry. But when the thread is waiting for mConfig lock, configure
function actually returns successfully, which moves the MediaCodec
to valid CONFIGURED state. But since the watchdog thread has
already decided that configure function has timed out, it calls
onError callback to MediaCodec. This moves the MediaCodec state
to UNINTIALIZED after the configure function was successful.
This chain of events creates problem when clients like nuplayer
tries to perform some action on MediaCodec after configure was
successful (but MediaCodec is nor in CONFIGURED state, due to
above onError callback).

So, watchdog thread should check for function timeout just before
calling onError callback to avoid such race conditions.

Bug: 245494175

Change-Id: I6a7d250c7475cb40d25775bfc56ff6c13239afb8
parent b22c6b25
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment