diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 586144ca28f..cbf79d1a9db 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -90,6 +90,9 @@ * Rename `MediaSessionConnector.QueueNavigator#onCurrentWindowIndexChanged` to `onCurrentMediaItemIndexChanged`. +* Transformer: + * Avoid sending a duplicate timestamp to the encoder with the end of + stream buffer. * Remove deprecated symbols: * Remove `Renderer.VIDEO_SCALING_MODE_*` constants. Use identically named constants in `C` instead. diff --git a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerAudioRenderer.java b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerAudioRenderer.java index f20915c1208..7efa0eb7803 100644 --- a/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerAudioRenderer.java +++ b/library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerAudioRenderer.java @@ -316,6 +316,7 @@ private void feedEncoder(MediaCodecAdapterWrapper encoder, ByteBuffer inputBuffe private void queueEndOfStreamToEncoder(MediaCodecAdapterWrapper encoder) { checkState(checkNotNull(encoderInputBuffer.data).position() == 0); + encoderInputBuffer.timeUs = nextEncoderInputBufferTimeUs; encoderInputBuffer.addFlag(C.BUFFER_FLAG_END_OF_STREAM); encoderInputBuffer.flip(); // Queuing EOS should only occur with an empty buffer.