From 082542c152d6ba711792cdb21c208c7f2dc2489a Mon Sep 17 00:00:00 2001 From: olly Date: Fri, 20 Aug 2021 10:55:15 +0100 Subject: [PATCH] Add note that isLastBuffer is best-effort only PiperOrigin-RevId: 391952144 --- .../android/exoplayer2/mediacodec/MediaCodecRenderer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java index ead65ded66..75ac662ff3 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java @@ -1968,7 +1968,9 @@ public abstract class MediaCodecRenderer extends BaseRenderer { * @param bufferPresentationTimeUs The presentation time of the output buffer in microseconds. * @param isDecodeOnlyBuffer Whether the buffer was marked with {@link C#BUFFER_FLAG_DECODE_ONLY} * by the source. - * @param isLastBuffer Whether the buffer is the last sample of the current stream. + * @param isLastBuffer Whether the buffer is known to contain the last sample of the current + * stream. This flag is set on a best effort basis, and any logic relying on it should degrade + * gracefully to handle cases where it's not set. * @param format The {@link Format} associated with the buffer. * @return Whether the output buffer was fully processed (for example, rendered or skipped). * @throws ExoPlaybackException If an error occurs processing the output buffer.