Commit 83758577 by samrobinson Committed by Ian Baker

Temporary fix for gapless regression for MP3.

PiperOrigin-RevId: 315334491
parent b1e56304
...@@ -1391,8 +1391,15 @@ public abstract class MediaCodecRenderer extends BaseRenderer { ...@@ -1391,8 +1391,15 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
formatQueue.add(presentationTimeUs, inputFormat); formatQueue.add(presentationTimeUs, inputFormat);
waitingForFirstSampleInFormat = false; waitingForFirstSampleInFormat = false;
} }
largestQueuedPresentationTimeUs = Math.max(largestQueuedPresentationTimeUs, presentationTimeUs);
// TODO(b/158483277): Find the root cause of why a gap is introduced in MP3 playback when using
// presentationTimeUs from the c2Mp3TimestampTracker.
if (c2Mp3TimestampTracker != null) {
largestQueuedPresentationTimeUs = Math.max(largestQueuedPresentationTimeUs, buffer.timeUs);
} else {
largestQueuedPresentationTimeUs =
Math.max(largestQueuedPresentationTimeUs, presentationTimeUs);
}
buffer.flip(); buffer.flip();
if (buffer.hasSupplementalData()) { if (buffer.hasSupplementalData()) {
handleInputBufferSupplementalData(buffer); handleInputBufferSupplementalData(buffer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment