mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-26 14:32:42 +00:00
Submit codec config data with a timestamp of 0 like MediaCodec does with csd-0
This commit is contained in:
parent
82619063ee
commit
bd64dfb661
@ -772,17 +772,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
|||||||
|
|
||||||
int inputBufferIndex;
|
int inputBufferIndex;
|
||||||
ByteBuffer buf;
|
ByteBuffer buf;
|
||||||
|
long timestampUs;
|
||||||
long timestampUs = enqueueTimeMs * 1000;
|
|
||||||
|
|
||||||
if (timestampUs <= lastTimestampUs) {
|
|
||||||
// We can't submit multiple buffers with the same timestamp
|
|
||||||
// so bump it up by one before queuing
|
|
||||||
timestampUs = lastTimestampUs + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
lastTimestampUs = timestampUs;
|
|
||||||
|
|
||||||
int codecFlags = 0;
|
int codecFlags = 0;
|
||||||
|
|
||||||
// H264 SPS
|
// H264 SPS
|
||||||
@ -948,6 +938,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
|||||||
|
|
||||||
// This is the CSD blob
|
// This is the CSD blob
|
||||||
codecFlags |= MediaCodec.BUFFER_FLAG_CODEC_CONFIG;
|
codecFlags |= MediaCodec.BUFFER_FLAG_CODEC_CONFIG;
|
||||||
|
timestampUs = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Batch this to submit together with the next I-frame
|
// Batch this to submit together with the next I-frame
|
||||||
@ -1001,6 +992,16 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
|||||||
codecFlags |= MediaCodec.BUFFER_FLAG_SYNC_FRAME;
|
codecFlags |= MediaCodec.BUFFER_FLAG_SYNC_FRAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
timestampUs = enqueueTimeMs * 1000;
|
||||||
|
|
||||||
|
if (timestampUs <= lastTimestampUs) {
|
||||||
|
// We can't submit multiple buffers with the same timestamp
|
||||||
|
// so bump it up by one before queuing
|
||||||
|
timestampUs = lastTimestampUs + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
lastTimestampUs = timestampUs;
|
||||||
|
|
||||||
numFramesIn++;
|
numFramesIn++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1071,8 +1072,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
|||||||
// Queue the new SPS
|
// Queue the new SPS
|
||||||
return queueInputBuffer(inputIndex,
|
return queueInputBuffer(inputIndex,
|
||||||
0, inputBuffer.position(),
|
0, inputBuffer.position(),
|
||||||
System.nanoTime() / 1000,
|
0, MediaCodec.BUFFER_FLAG_CODEC_CONFIG);
|
||||||
MediaCodec.BUFFER_FLAG_CODEC_CONFIG);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user