Commit 775983c3 by hschlueter Committed by tonihei

Flip input buffer even if the end of stream is reached.

Sometimes the empty end of stream buffer has a non-zero
data limit. Calling flip first, resets the limit to the
position which is zero in these cases.

PiperOrigin-RevId: 413156455
parent 5694a07a
......@@ -197,13 +197,13 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
int result = readSource(getFormatHolder(), samplePipelineInputBuffer, /* readFlags= */ 0);
switch (result) {
case C.RESULT_BUFFER_READ:
samplePipelineInputBuffer.flip();
if (samplePipelineInputBuffer.isEndOfStream()) {
samplePipeline.queueInputBuffer();
return false;
}
mediaClock.updateTimeForTrackType(getTrackType(), samplePipelineInputBuffer.timeUs);
samplePipelineInputBuffer.timeUs -= streamOffsetUs;
samplePipelineInputBuffer.flip();
checkStateNotNull(samplePipelineInputBuffer.data);
maybeQueueSampleToPipeline(samplePipelineInputBuffer);
return true;
......
......@@ -299,12 +299,6 @@ sample:
isKeyFrame = false
presentationTimeUs = 734083
sample:
trackIndex = 0
dataHashCode = 820561200
size = 1252
isKeyFrame = true
presentationTimeUs = 201521
sample:
trackIndex = 1
dataHashCode = -1554795381
size = 205
......
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