Don't flip() TextTrackRenderer EoS input buffers.

TextTrackRenderer would unconditionally flip input buffers read from its
source TrackStream, but the data could be null in the case where the buffer
signaled end of stream. Only flip if the corresponding flag is not set.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124559077
This commit is contained in:
andrewlewis 2016-06-10 07:27:20 -07:00 committed by Oliver Woodman
parent 4279e22138
commit 2a3b4f6780

View File

@ -198,8 +198,8 @@ public final class TextTrackRenderer extends TrackRenderer implements Callback {
inputStreamEnded = true;
} else {
nextInputBuffer.subsampleOffsetUs = formatHolder.format.subsampleOffsetUs;
nextInputBuffer.flip();
}
nextInputBuffer.flip();
parser.queueInputBuffer(nextInputBuffer);
nextInputBuffer = null;
} else if (result == TrackStream.NOTHING_READ) {