Block for 100 ms instead of 100 us waiting for a frame. This reduces the CPU time wasted by useless iterations of the rendering loop.

This commit is contained in:
Cameron Gutman 2014-02-19 19:49:57 -05:00
parent c537af2273
commit 6fc848ef56

View File

@ -121,7 +121,8 @@ public class MediaCodecDecoderRenderer implements VideoDecoderRenderer {
BufferInfo info = new BufferInfo();
while (!isInterrupted())
{
int outIndex = videoDecoder.dequeueOutputBuffer(info, 100);
// Block for a maximum of 100 ms
int outIndex = videoDecoder.dequeueOutputBuffer(info, 100000);
switch (outIndex) {
case MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED:
System.out.println("Output buffers changed");