From eea6fc0c13ccd7aafb7fb7bf0620a46089a56785 Mon Sep 17 00:00:00 2001 From: hschlueter Date: Tue, 12 Apr 2022 11:26:49 +0100 Subject: [PATCH] Fix FrameProcessorChain method ordering. signalEndOfInputStream makes more sense before isEnded and getPendingInputFrameCount is related to registerInputFrame. PiperOrigin-RevId: 441134418 --- .../transformer/FrameProcessorChain.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameProcessorChain.java b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameProcessorChain.java index 3237e3a004..c782f63164 100644 --- a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameProcessorChain.java +++ b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameProcessorChain.java @@ -323,6 +323,14 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; pendingFrameCount.incrementAndGet(); } + /** + * Returns the number of input frames that have been {@linkplain #registerInputFrame() registered} + * but not completely processed yet. + */ + public int getPendingFrameCount() { + return pendingFrameCount.get(); + } + /** * Checks whether any exceptions occurred during asynchronous frame processing and rethrows the * first exception encountered. @@ -345,12 +353,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; } } - /** - * Returns the number of input frames that have been {@linkplain #registerInputFrame() registered} - * but not completely processed yet. - */ - public int getPendingFrameCount() { - return pendingFrameCount.get(); + /** Informs the {@code FrameProcessorChain} that no further input frames should be accepted. */ + public void signalEndOfInputStream() { + inputStreamEnded = true; } /** Returns whether all frames have been processed. */ @@ -358,11 +363,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; return inputStreamEnded && getPendingFrameCount() == 0; } - /** Informs the {@code FrameProcessorChain} that no further input frames should be accepted. */ - public void signalEndOfInputStream() { - inputStreamEnded = true; - } - /** * Releases all resources. *