Closed pineapplevine closed 5 days ago
Thanks for raising this, and the suggestion to try re-adding the MediaCodec.stop()
call. I've tried this using my repro example for https://github.com/google/ExoPlayer/issues/8696 on a OnePlus AC2003 device (and removing the Thread.sleep
workaround) and I agree it also resolves the issue (and removing both reintroduces it). I also agree the 50ms delay is arbitrary and unlikely to be correct for all devices (too long for some, too short for others). I will submit a change to remove the 50ms sleep and call MediaCodec.stop()
before MediaCodec.release()
on the affected Android versions (APIs 30, 31 & 32).
Hi! In a previous issue, support for retrying initCodec when the codec initialization process failed. https://github.com/google/ExoPlayer/issues/8696
https://github.com/google/ExoPlayer/commit/07352a4585cd939805bc2dafe53166f02c7e9025
The above code mean, retries codec initialization after waiting for 50ms if the codec initialization process fails. However, the 50ms wait time may depend on the performance of the device. In other commit, removed the process that called the MediaCodec.stop() before MediaCodec.release(). I think that calling MediaCodec.stop() before MediaCodec.release() will provide sufficient waiting time. https://github.com/google/ExoPlayer/commit/0e1e4ad737cafa3a166815d34ee81c3d8d2e23d4