mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 02:53:05 +00:00
Fix crash when input events are received and no H.264 decoder is present
This commit is contained in:
parent
99d2e40683
commit
b6f52db9c3
@ -295,18 +295,6 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
Toast.makeText(this, "No H.265 decoder found.\nFalling back to H.264.", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
if (!decoderRenderer.isAvcSupported()) {
|
||||
if (spinner != null) {
|
||||
spinner.dismiss();
|
||||
spinner = null;
|
||||
}
|
||||
|
||||
// If we can't find an AVC decoder, we can't proceed
|
||||
Dialog.displayDialog(this, getResources().getString(R.string.conn_error_title),
|
||||
"This device or ROM doesn't support hardware accelerated H.264 playback.", true);
|
||||
return;
|
||||
}
|
||||
|
||||
StreamConfiguration config = new StreamConfiguration.Builder()
|
||||
.setResolution(prefConfig.width, prefConfig.height)
|
||||
.setRefreshRate(prefConfig.fps)
|
||||
@ -361,6 +349,18 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
usbDriverServiceConnection, Service.BIND_AUTO_CREATE);
|
||||
}
|
||||
|
||||
if (!decoderRenderer.isAvcSupported()) {
|
||||
if (spinner != null) {
|
||||
spinner.dismiss();
|
||||
spinner = null;
|
||||
}
|
||||
|
||||
// If we can't find an AVC decoder, we can't proceed
|
||||
Dialog.displayDialog(this, getResources().getString(R.string.conn_error_title),
|
||||
"This device or ROM doesn't support hardware accelerated H.264 playback.", true);
|
||||
return;
|
||||
}
|
||||
|
||||
// The connection will be started when the surface gets created
|
||||
streamView.getHolder().addCallback(this);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user