Commit acef34a6 by andrewlewis Committed by Oliver Woodman

Set the output buffer position/limit only if it's non-null.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127196797
parent d4d16408
......@@ -822,8 +822,10 @@ public abstract class MediaCodecRenderer extends Renderer {
// The dequeued buffer is a media buffer. Do some initial setup. The buffer will be
// processed by calling processOutputBuffer (possibly multiple times) below.
ByteBuffer outputBuffer = outputBuffers[outputIndex];
outputBuffer.position(outputBufferInfo.offset);
outputBuffer.limit(outputBufferInfo.offset + outputBufferInfo.size);
if (outputBuffer != null) {
outputBuffer.position(outputBufferInfo.offset);
outputBuffer.limit(outputBufferInfo.offset + outputBufferInfo.size);
}
shouldSkipOutputBuffer = shouldSkipOutputBuffer(outputBufferInfo.presentationTimeUs);
}
} else if (outputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED /* (-2) */) {
......
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