Commit da52de66 by kimvde Committed by Oliver Woodman

Avoid skipping the first decoder output buffers after speed change

#minor-release

PiperOrigin-RevId: 355652144
parent 5107fea5
......@@ -227,12 +227,11 @@ import java.nio.ByteBuffer;
MediaCodecAdapterWrapper decoder = checkNotNull(this.decoder);
if (drainingSonicForSpeedChange) {
if (!sonicAudioProcessor.isEnded()) {
// Sonic needs draining, but has not fully drained yet.
return false;
if (sonicAudioProcessor.isEnded() && !sonicOutputBuffer.hasRemaining()) {
flushSonicAndSetSpeed(currentSpeed);
drainingSonicForSpeedChange = false;
}
flushSonicAndSetSpeed(currentSpeed);
drainingSonicForSpeedChange = false;
return false;
}
// Sonic invalidates any previous output buffer when more input is queued, so we don't queue if
......
......@@ -123,14 +123,44 @@ sample:
presentationTimeUs = 36499
sample:
trackIndex = 0
dataHashCode = -2124187794
dataHashCode = 250093960
isKeyFrame = true
presentationTimeUs = 44415
sample:
trackIndex = 0
dataHashCode = 1016665126
dataHashCode = 1895536226
isKeyFrame = true
presentationTimeUs = 63081
presentationTimeUs = 59998
sample:
trackIndex = 0
dataHashCode = 1723596464
isKeyFrame = true
presentationTimeUs = 81748
sample:
trackIndex = 0
dataHashCode = -978803114
isKeyFrame = true
presentationTimeUs = 101414
sample:
trackIndex = 0
dataHashCode = 387377078
isKeyFrame = true
presentationTimeUs = 121080
sample:
trackIndex = 0
dataHashCode = -132658698
isKeyFrame = true
presentationTimeUs = 140746
sample:
trackIndex = 0
dataHashCode = 1495036471
isKeyFrame = true
presentationTimeUs = 159496
sample:
trackIndex = 0
dataHashCode = 304440590
isKeyFrame = true
presentationTimeUs = 178162
sample:
trackIndex = 1
dataHashCode = 2139021989
......@@ -152,6 +182,11 @@ sample:
isKeyFrame = false
presentationTimeUs = 734083
sample:
trackIndex = 0
dataHashCode = -752661703
isKeyFrame = true
presentationTimeUs = 196412
sample:
trackIndex = 1
dataHashCode = -1554795381
isKeyFrame = false
......
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