Simplify (i.e. remove) waiting for first sync frame.
The upstream source (or its stream) should always provide data starting from a sync frame, so this logic shouldn't be necessary. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=117220759
This commit is contained in:
parent
b37e9f6980
commit
b1c356fbab
@ -228,7 +228,6 @@ public abstract class MediaCodecTrackRenderer extends SampleSourceTrackRenderer
|
|||||||
private boolean inputStreamEnded;
|
private boolean inputStreamEnded;
|
||||||
private boolean outputStreamEnded;
|
private boolean outputStreamEnded;
|
||||||
private boolean waitingForKeys;
|
private boolean waitingForKeys;
|
||||||
private boolean waitingForFirstSyncFrame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mediaCodecSelector A decoder selector.
|
* @param mediaCodecSelector A decoder selector.
|
||||||
@ -384,7 +383,6 @@ public abstract class MediaCodecTrackRenderer extends SampleSourceTrackRenderer
|
|||||||
SystemClock.elapsedRealtime() : -1;
|
SystemClock.elapsedRealtime() : -1;
|
||||||
inputIndex = -1;
|
inputIndex = -1;
|
||||||
outputIndex = -1;
|
outputIndex = -1;
|
||||||
waitingForFirstSyncFrame = true;
|
|
||||||
codecCounters.codecInitCount++;
|
codecCounters.codecInitCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -507,7 +505,6 @@ public abstract class MediaCodecTrackRenderer extends SampleSourceTrackRenderer
|
|||||||
codecHotswapTimeMs = -1;
|
codecHotswapTimeMs = -1;
|
||||||
inputIndex = -1;
|
inputIndex = -1;
|
||||||
outputIndex = -1;
|
outputIndex = -1;
|
||||||
waitingForFirstSyncFrame = true;
|
|
||||||
waitingForKeys = false;
|
waitingForKeys = false;
|
||||||
decodeOnlyPresentationTimestamps.clear();
|
decodeOnlyPresentationTimestamps.clear();
|
||||||
if (codecNeedsFlushWorkaround || (codecNeedsEosFlushWorkaround && codecReceivedEos)) {
|
if (codecNeedsFlushWorkaround || (codecNeedsEosFlushWorkaround && codecReceivedEos)) {
|
||||||
@ -628,20 +625,6 @@ public abstract class MediaCodecTrackRenderer extends SampleSourceTrackRenderer
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (waitingForFirstSyncFrame) {
|
|
||||||
// TODO: Find out if it's possible to supply samples prior to the first sync
|
|
||||||
// frame for HE-AAC.
|
|
||||||
if (!sampleHolder.isSyncFrame()) {
|
|
||||||
sampleHolder.clearData();
|
|
||||||
if (codecReconfigurationState == RECONFIGURATION_STATE_QUEUE_PENDING) {
|
|
||||||
// The buffer we just cleared contained reconfiguration data. We need to re-write this
|
|
||||||
// data into a subsequent buffer (if there is one).
|
|
||||||
codecReconfigurationState = RECONFIGURATION_STATE_WRITE_PENDING;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
waitingForFirstSyncFrame = false;
|
|
||||||
}
|
|
||||||
boolean sampleEncrypted = sampleHolder.isEncrypted();
|
boolean sampleEncrypted = sampleHolder.isEncrypted();
|
||||||
waitingForKeys = shouldWaitForKeys(sampleEncrypted);
|
waitingForKeys = shouldWaitForKeys(sampleEncrypted);
|
||||||
if (waitingForKeys) {
|
if (waitingForKeys) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user