media3/libraries
christosts 0221e0e159 Async buffer queueing: do not throw from flush/shutdown
The asynchronous MediaCodec adapter queues input buffers in a
background thread. If a codec queueuing operation throws an exception,
the buffer enqueuer will store it as a pending exception and re-throw it
the next time the adapter will attempt to queue another input buffer.

The buffer enqueuer's flush() and shutdown() may throw an exception if
the pending error is set. This is subject to a race-condition in which
the pending error can be set while the adapter is flushing/shutting down
the enqueuer, e.g., if an input buffer is still being queued and the
codec throws an exception. As a result, the adapter cannot flush or
shutdown gracefully.

This change makes the buffer enqueuer to ignore any pending error
when flushing/shuttinf down so that the adapter can flush/release
gracefully even if a queueing error was detected.

PiperOrigin-RevId: 409113054
2021-11-19 14:39:00 +00:00
..
2021-10-27 09:12:46 +01:00
2021-10-27 09:12:46 +01:00
2021-11-19 14:35:52 +00:00