mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-04 00:35:47 +00:00
Remove strict codec recovery timeout
Codec recovery depends on incoming frames, so it cannot be reliably time-constrained
This commit is contained in:
parent
7d8cfa3c6a
commit
67bcc56c6d
@ -76,7 +76,6 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
|||||||
private boolean foreground = true;
|
private boolean foreground = true;
|
||||||
private PerfOverlayListener perfListener;
|
private PerfOverlayListener perfListener;
|
||||||
|
|
||||||
private static final int CR_TIMEOUT_MS = 5000;
|
|
||||||
private static final int CR_MAX_TRIES = 10;
|
private static final int CR_MAX_TRIES = 10;
|
||||||
private static final int CR_RECOVERY_TYPE_NONE = 0;
|
private static final int CR_RECOVERY_TYPE_NONE = 0;
|
||||||
private static final int CR_RECOVERY_TYPE_FLUSH = 1;
|
private static final int CR_RECOVERY_TYPE_FLUSH = 1;
|
||||||
@ -730,14 +729,10 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
|||||||
else {
|
else {
|
||||||
// If we haven't quiesced all threads yet, wait to be signalled after recovery.
|
// If we haven't quiesced all threads yet, wait to be signalled after recovery.
|
||||||
// The final thread to be quiesced will handle the codec recovery.
|
// The final thread to be quiesced will handle the codec recovery.
|
||||||
LimeLog.info("Waiting to quiesce decoder threads: "+codecRecoveryThreadQuiescedFlags);
|
|
||||||
long startTime = SystemClock.uptimeMillis();
|
|
||||||
while (codecRecoveryType.get() != CR_RECOVERY_TYPE_NONE) {
|
while (codecRecoveryType.get() != CR_RECOVERY_TYPE_NONE) {
|
||||||
try {
|
try {
|
||||||
if (SystemClock.uptimeMillis() - startTime >= CR_TIMEOUT_MS) {
|
LimeLog.info("Waiting to quiesce decoder threads: "+codecRecoveryThreadQuiescedFlags);
|
||||||
throw new IllegalStateException("Decoder failed to recover within timeout");
|
codecRecoveryMonitor.wait(1000);
|
||||||
}
|
|
||||||
codecRecoveryMonitor.wait(CR_TIMEOUT_MS);
|
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user