Stop audio track writing when playback is paused

When audio track pauses, it may at the stage of writing audio buffer,
and waiting for free spaces. After codec flush and audio track re-play,
the writing finishes, and releaseOutputBuffer is called. But after
flushing, the test crashes, because the output buffer is not owned by
the client. Additionally, The are also outstanding onOutputBufferAvailable, which could also cause the crash.

Changing the while condition to check mDone fixes the problem, as it
unblocks the writing and the invalid callbacks are ignored after codec
flush and before start.

Test: atest DecodeOnlyTest
Bug: 291202816

Change-Id: Ia56351a6911c26d4319893413ab2073b8b1ed661
1 file changed