Commit 8f43dcd4 by tonihei Committed by Oliver Woodman

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