Allow frame count regress in AudioStreamOut
AudioStreamOut attempts to detect wraparound by assuming that the
HAL frame count is monotonic, which is not true wrt gapless offload
tracks. When a non-monotonic update is detected, we freeze the fw
side framecount, rather than updating. The exception is when we
are notified that framecount will reset (e.g. flush()).
Since the notification that we are transitioning can occur arbitrarily
in advance from the HAL, upon presentationComplete for a offload stream,
we notify AudioStreamOut that we expect an upcoming framecount reset
from the HAL.
Then, we do not suppress the next detected non-monotonic sample, and
appropriately decrease the uint64 mRenderPosition.
Test: offloadAudioTrackPlayer manual test app (exoplayer test in
google3)
Bug: 191950723
Change-Id: I6060d0a9750783c2e2a7b46ce592c042d1405aa0
3 files changed