From db1b5f148d7e863609b5763fc870123aeaeb85da Mon Sep 17 00:00:00 2001 From: huangdarwin Date: Wed, 31 May 2023 12:04:35 +0000 Subject: [PATCH] Exoplayer: Suppress check to allow video to run ahead of Audio. Otherwise, texture output errors out if video decoding decodes faster than audio, hitting the end of the file, while audio is still in the middle of the file. PiperOrigin-RevId: 536679568 (cherry picked from commit e2821f10f5ad9d88ab30c7ea50b815cb8854801f) --- .../media3/exoplayer/video/MediaCodecVideoRenderer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/MediaCodecVideoRenderer.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/MediaCodecVideoRenderer.java index 3d848899ce..2f929ee882 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/MediaCodecVideoRenderer.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/MediaCodecVideoRenderer.java @@ -2200,7 +2200,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { Format format, long presentationTimestampUs, boolean isLastBuffer) { checkStateNotNull(videoFrameProcessor); checkState(videoFrameProcessorMaxPendingFrameCount != C.LENGTH_UNSET); - checkState(!registeredLastFrame); + if (videoFrameProcessor.getPendingInputFrameCount() < videoFrameProcessorMaxPendingFrameCount) { videoFrameProcessor.registerInputFrame();