mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-23 16:56:41 +00:00
Don't crash if no performance data was provided for the codec using the M API
This commit is contained in:
@@ -132,7 +132,11 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
|||||||
// We'll ask the decoder what it can do for us at this resolution and see if our
|
// We'll ask the decoder what it can do for us at this resolution and see if our
|
||||||
// requested frame rate falls below or inside the range of achievable frame rates.
|
// requested frame rate falls below or inside the range of achievable frame rates.
|
||||||
Range<Double> fpsRange = caps.getAchievableFrameRatesFor(prefs.width, prefs.height);
|
Range<Double> fpsRange = caps.getAchievableFrameRatesFor(prefs.width, prefs.height);
|
||||||
return prefs.fps <= fpsRange.getUpper();
|
if (fpsRange != null) {
|
||||||
|
return prefs.fps <= fpsRange.getUpper();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fall-through to try the Android L API if there's no performance point data
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
// Video size not supported at any frame rate
|
// Video size not supported at any frame rate
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user