Clear buffer in fake renderer in each iteration.

This simulates reading from the buffer (which is what actual
renderers would do). Otherwise the buffer always gets expanded
and might cause memory issues.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167994899
This commit is contained in:
tonihei 2017-09-08 07:34:07 -07:00 committed by Oliver Woodman
parent b2627d63fd
commit 8f43dcd424

View file

@ -59,6 +59,7 @@ public class FakeRenderer extends BaseRenderer {
@Override
public void render(long positionUs, long elapsedRealtimeUs) throws ExoPlaybackException {
if (!isEnded) {
buffer.clear();
// Verify the format matches the expected format.
FormatHolder formatHolder = new FormatHolder();
int result = readSource(formatHolder, buffer, false);