Handle decoder exceptions in dequeueInputBuffer

This commit is contained in:
Cameron Gutman 2017-05-18 10:25:48 -07:00
parent d0ecde1e16
commit 686490ba70

View File

@ -358,8 +358,13 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
startTime = MediaCodecHelper.getMonotonicMillis(); startTime = MediaCodecHelper.getMonotonicMillis();
while (rendererThread.isAlive() && index < 0 && !stopping) { try {
index = videoDecoder.dequeueInputBuffer(10000); while (rendererThread.isAlive() && index < 0 && !stopping) {
index = videoDecoder.dequeueInputBuffer(10000);
}
} catch (Exception e) {
handleDecoderException(e, null, 0);
return MediaCodec.INFO_TRY_AGAIN_LATER;
} }
if (index < 0) { if (index < 0) {