Propagate the possible exceptions during codec capability checks to the caller so a nice dialog can be displayed instead of crashing on buggy ROMs. Small change to evdev shutdown.

This commit is contained in:
Cameron Gutman
2014-09-03 20:00:00 -07:00
parent 2c23dbd2be
commit 178c53ee84
3 changed files with 16 additions and 4 deletions

View File

@@ -91,7 +91,10 @@ public class MediaCodecDecoderRenderer implements VideoDecoderRenderer {
}
}
public static MediaCodecInfo findSafeDecoder() {
// We declare this method as explicitly throwing Exception
// since some bad decoders can throw IllegalArgumentExceptions unexpectedly
// and we want to be sure all callers are handling this possibility
public static MediaCodecInfo findSafeDecoder() throws Exception {
for (int i = 0; i < MediaCodecList.getCodecCount(); i++) {
MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);