Return the correct output buffer from audio processing pipeline

PiperOrigin-RevId: 554851456
This commit is contained in:
Googler 2023-08-08 16:36:29 +00:00 committed by Tianyi Feng
parent 3ec462d1cf
commit 4fe55b8b63
6 changed files with 27 additions and 61 deletions

View File

@ -222,12 +222,14 @@ public final class AudioProcessingPipeline {
return EMPTY_BUFFER;
}
ByteBuffer outputBuffer = outputBuffers[getFinalOutputBufferIndex()];
if (!outputBuffer.hasRemaining()) {
processData(EMPTY_BUFFER);
}
if (outputBuffer.hasRemaining()) {
return outputBuffer;
}
processData(EMPTY_BUFFER);
return outputBuffers[getFinalOutputBufferIndex()];
}
/**
* Queues an end of stream signal. After this method has been called, {@link
* #queueInput(ByteBuffer)} should not be called until after the next call to {@link #flush()}.

View File

@ -2132,16 +2132,16 @@ sample:
presentationTimeUs = 3145020
sample:
trackIndex = 1
dataHashCode = 202646529
size = 4320
dataHashCode = -738966527
size = 8160
isKeyFrame = true
presentationTimeUs = 3165020
sample:
trackIndex = 1
dataHashCode = -738966527
size = 8160
dataHashCode = 202646529
size = 4320
isKeyFrame = true
presentationTimeUs = 3187520
presentationTimeUs = 3207520
sample:
trackIndex = 1
dataHashCode = -1017110527
@ -2186,16 +2186,10 @@ sample:
presentationTimeUs = 3357520
sample:
trackIndex = 1
dataHashCode = 202646529
size = 4320
dataHashCode = -738966527
size = 8160
isKeyFrame = true
presentationTimeUs = 3377520
sample:
trackIndex = 1
dataHashCode = -1017110527
size = 3840
isKeyFrame = true
presentationTimeUs = 3400020
sample:
trackIndex = 1
dataHashCode = 202646529
@ -2228,16 +2222,16 @@ sample:
presentationTimeUs = 3500000
sample:
trackIndex = 1
dataHashCode = -738966527
size = 8160
dataHashCode = 202646529
size = 4320
isKeyFrame = true
presentationTimeUs = 3527520
sample:
trackIndex = 1
dataHashCode = 202646529
size = 4320
dataHashCode = -738966527
size = 8160
isKeyFrame = true
presentationTimeUs = 3570020
presentationTimeUs = 3550020
sample:
trackIndex = 1
dataHashCode = -1017110527
@ -2336,16 +2330,10 @@ sample:
presentationTimeUs = 3932520
sample:
trackIndex = 1
dataHashCode = 304617473
size = 2880
dataHashCode = -422154111
size = 8636
isKeyFrame = true
presentationTimeUs = 3955020
sample:
trackIndex = 1
dataHashCode = -933078911
size = 5756
isKeyFrame = true
presentationTimeUs = 3970020
sample:
trackIndex = 1
dataHashCode = -1807454463

View File

@ -1704,16 +1704,10 @@ sample:
presentationTimeUs = 1942902
sample:
trackIndex = 1
dataHashCode = -1759454975
size = 440
dataHashCode = 359941761
size = 5644
isKeyFrame = true
presentationTimeUs = 1967845
sample:
trackIndex = 1
dataHashCode = -1409159807
size = 5204
isKeyFrame = true
presentationTimeUs = 1970340
sample:
trackIndex = 1
dataHashCode = 693101697

View File

@ -1704,16 +1704,10 @@ sample:
presentationTimeUs = 1942902
sample:
trackIndex = 1
dataHashCode = -1759454975
size = 440
dataHashCode = 359941761
size = 5644
isKeyFrame = true
presentationTimeUs = 1967845
sample:
trackIndex = 1
dataHashCode = -1409159807
size = 5204
isKeyFrame = true
presentationTimeUs = 1970340
sample:
trackIndex = 1
dataHashCode = -752508258

View File

@ -1704,16 +1704,10 @@ sample:
presentationTimeUs = 1942902
sample:
trackIndex = 1
dataHashCode = -1759454975
size = 440
dataHashCode = 359941761
size = 5644
isKeyFrame = true
presentationTimeUs = 1967845
sample:
trackIndex = 1
dataHashCode = -1409159807
size = 5204
isKeyFrame = true
presentationTimeUs = 1970340
sample:
trackIndex = 1
dataHashCode = 693101697

View File

@ -1704,16 +1704,10 @@ sample:
presentationTimeUs = 1942902
sample:
trackIndex = 1
dataHashCode = -1759454975
size = 440
dataHashCode = 359941761
size = 5644
isKeyFrame = true
presentationTimeUs = 1967845
sample:
trackIndex = 1
dataHashCode = -1409159807
size = 5204
isKeyFrame = true
presentationTimeUs = 1970340
sample:
trackIndex = 1
dataHashCode = 693101697