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
+11 -2
View File
@@ -198,7 +198,16 @@ public class Game extends Activity implements SurfaceHolder.Callback,
controllerHandler = new ControllerHandler(conn);
decoderRenderer = new ConfigurableDecoderRenderer();
decoderRenderer.initializeWithFlags(drFlags);
try {
decoderRenderer.initializeWithFlags(drFlags);
} catch (Exception e) {
Dialog.displayDialog(this, "Hardware Decoder Failure",
"The hardware decoder failed to initialize. First, try restarting your device."+
"If the issue persists, please send an email to the app developer. Forcing software decoding" +
"can circumvent this error if needed.", true);
return;
}
SurfaceHolder sh = sv.getHolder();
if (stretchToFit || !decoderRenderer.isHardwareAccelerated()) {
@@ -301,7 +310,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
}
if (LimelightBuildProps.ROOT_BUILD) {
if (evdevWatcher != null) {
evdevWatcher.shutdown();
}