mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 11:33:06 +00:00
Small performance optimization by only blocking on an input buffer if we've already got a DU
This commit is contained in:
parent
47d47afd73
commit
8403101d0f
@ -327,9 +327,10 @@ public class MediaCodecDecoderRenderer implements VideoDecoderRenderer {
|
|||||||
// frames out of the other end.
|
// frames out of the other end.
|
||||||
if (inputIndex == -1) {
|
if (inputIndex == -1) {
|
||||||
try {
|
try {
|
||||||
// Wait for 3 milliseconds at maximum before continuing to
|
// If we've got a DU waiting to be given to the decoder,
|
||||||
// grab a DU or render a frame
|
// wait a full 3 ms for an input buffer. Otherwise
|
||||||
inputIndex = videoDecoder.dequeueInputBuffer(3000);
|
// just see if we can get one immediately.
|
||||||
|
inputIndex = videoDecoder.dequeueInputBuffer(du != null ? 3000 : 0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RendererException(MediaCodecDecoderRenderer.this, e);
|
throw new RendererException(MediaCodecDecoderRenderer.this, e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user