Compare commits
2 Commits
fix_audio_
...
fix_audio_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f7869d130 | ||
|
|
0f28d39127 |
@@ -163,7 +163,7 @@ public final class AudioCapture {
|
|||||||
// - an estimation from the previous PTS and the packet size as a fallback.
|
// - an estimation from the previous PTS and the packet size as a fallback.
|
||||||
//
|
//
|
||||||
// Therefore, the property that PTS are monotonically increasing is no guaranteed in corner cases, so enforce it.
|
// Therefore, the property that PTS are monotonically increasing is no guaranteed in corner cases, so enforce it.
|
||||||
pts = previousPts + 1;
|
pts = previousPts;
|
||||||
}
|
}
|
||||||
previousPts = pts;
|
previousPts = pts;
|
||||||
|
|
||||||
|
|||||||
@@ -109,9 +109,9 @@ public final class AudioEncoder implements AsyncProcessor {
|
|||||||
while (!Thread.currentThread().isInterrupted()) {
|
while (!Thread.currentThread().isInterrupted()) {
|
||||||
OutputTask task = outputTasks.take();
|
OutputTask task = outputTasks.take();
|
||||||
|
|
||||||
if (task.bufferInfo.presentationTimeUs <= lastPts) {
|
if (task.bufferInfo.presentationTimeUs < lastPts) {
|
||||||
// Fix PTS if not strictly monotonically increasing
|
// Fix PTS if not monotonically increasing
|
||||||
task.bufferInfo.presentationTimeUs = ++lastPts;
|
task.bufferInfo.presentationTimeUs = lastPts;
|
||||||
} else {
|
} else {
|
||||||
lastPts = task.bufferInfo.presentationTimeUs;
|
lastPts = task.bufferInfo.presentationTimeUs;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user