mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-06 07:56:07 +00:00
A few fixes for decoder crash notifications
This commit is contained in:
@@ -49,6 +49,8 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
||||
private SurfaceHolder renderTarget;
|
||||
private volatile boolean stopping;
|
||||
private CrashListener crashListener;
|
||||
private boolean reportedCrash;
|
||||
private int consecutiveCrashCount;
|
||||
|
||||
private boolean needsBaselineSpsHack;
|
||||
private SeqParameterSet savedSps;
|
||||
@@ -111,11 +113,13 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
||||
this.renderTarget = renderTarget;
|
||||
}
|
||||
|
||||
public MediaCodecDecoderRenderer(int videoFormat, int bitrate, boolean batterySaver, CrashListener crashListener) {
|
||||
public MediaCodecDecoderRenderer(int videoFormat, int bitrate, boolean batterySaver,
|
||||
CrashListener crashListener, int consecutiveCrashCount) {
|
||||
//dumpDecoders();
|
||||
|
||||
this.bitrate = bitrate;
|
||||
this.crashListener = crashListener;
|
||||
this.consecutiveCrashCount = consecutiveCrashCount;
|
||||
|
||||
// Disable spinner threads in battery saver mode
|
||||
if (batterySaver) {
|
||||
@@ -320,7 +324,10 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
||||
// This isn't the first time we've had an exception processing video
|
||||
if (System.currentTimeMillis() - initialExceptionTimestamp >= EXCEPTION_REPORT_DELAY_MS) {
|
||||
// It's been over 3 seconds and we're still getting exceptions. Throw the original now.
|
||||
crashListener.notifyCrash(initialException);
|
||||
if (!reportedCrash) {
|
||||
reportedCrash = true;
|
||||
crashListener.notifyCrash(initialException);
|
||||
}
|
||||
throw initialException;
|
||||
}
|
||||
}
|
||||
@@ -916,6 +923,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
||||
str += "AVC Decoder: "+((renderer.avcDecoder != null) ? renderer.avcDecoder.getName():"(none)")+"\n";
|
||||
str += "HEVC Decoder: "+((renderer.hevcDecoder != null) ? renderer.hevcDecoder.getName():"(none)")+"\n";
|
||||
str += "Build fingerprint: "+Build.FINGERPRINT+"\n";
|
||||
str += "Consecutive crashes: "+renderer.consecutiveCrashCount+"\n";
|
||||
str += "Initial video dimensions: "+renderer.initialWidth+"x"+renderer.initialHeight+"\n";
|
||||
str += "FPS target: "+renderer.refreshRate+"\n";
|
||||
str += "Bitrate: "+renderer.bitrate+" Mbps \n";
|
||||
|
||||
Reference in New Issue
Block a user