From 41d5571660fe32de140c9e4d15882b91db112d3e Mon Sep 17 00:00:00 2001 From: kimvde Date: Mon, 15 Apr 2024 07:02:44 -0700 Subject: [PATCH] Allow sink provider to be flushed before initialized VideoSink.initialize will be added in a next CL and we want to allow flush to be called before and after initialize. PiperOrigin-RevId: 624946957 --- .../media3/exoplayer/video/CompositingVideoSinkProvider.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/CompositingVideoSinkProvider.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/CompositingVideoSinkProvider.java index bd8d7eb38e..4b0681b8d5 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/CompositingVideoSinkProvider.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/CompositingVideoSinkProvider.java @@ -505,6 +505,9 @@ public final class CompositingVideoSinkProvider } private void flush() { + if (!isInitialized()) { + return; + } pendingFlushCount++; // Flush the render control now to ensure it has no data, eg calling isReady() must return false // and render() should not render any frames.