mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Don't try to track buffersInCodec with tunneling
PiperOrigin-RevId: 283551324
This commit is contained in:
parent
6c10c94f94
commit
21dd59badb
1 changed files with 8 additions and 2 deletions
|
|
@ -763,7 +763,11 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||||
@CallSuper
|
@CallSuper
|
||||||
@Override
|
@Override
|
||||||
protected void onQueueInputBuffer(DecoderInputBuffer buffer) {
|
protected void onQueueInputBuffer(DecoderInputBuffer buffer) {
|
||||||
buffersInCodecCount++;
|
// In tunneling mode the device may do frame rate conversion, so in general we can't keep track
|
||||||
|
// of the number of buffers in the codec.
|
||||||
|
if (!tunneling) {
|
||||||
|
buffersInCodecCount++;
|
||||||
|
}
|
||||||
lastInputTimeUs = Math.max(buffer.timeUs, lastInputTimeUs);
|
lastInputTimeUs = Math.max(buffer.timeUs, lastInputTimeUs);
|
||||||
if (Util.SDK_INT < 23 && tunneling) {
|
if (Util.SDK_INT < 23 && tunneling) {
|
||||||
// In tunneled mode before API 23 we don't have a way to know when the buffer is output, so
|
// In tunneled mode before API 23 we don't have a way to know when the buffer is output, so
|
||||||
|
|
@ -1008,7 +1012,9 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||||
@CallSuper
|
@CallSuper
|
||||||
@Override
|
@Override
|
||||||
protected void onProcessedOutputBuffer(long presentationTimeUs) {
|
protected void onProcessedOutputBuffer(long presentationTimeUs) {
|
||||||
buffersInCodecCount--;
|
if (!tunneling) {
|
||||||
|
buffersInCodecCount--;
|
||||||
|
}
|
||||||
while (pendingOutputStreamOffsetCount != 0
|
while (pendingOutputStreamOffsetCount != 0
|
||||||
&& presentationTimeUs >= pendingOutputStreamSwitchTimesUs[0]) {
|
&& presentationTimeUs >= pendingOutputStreamSwitchTimesUs[0]) {
|
||||||
outputStreamOffsetUs = pendingOutputStreamOffsetsUs[0];
|
outputStreamOffsetUs = pendingOutputStreamOffsetsUs[0];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue