summaryrefslogtreecommitdiff
path: root/audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio.c')
-rw-r--r--audio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/audio.c b/audio.c
index adb19c7..f7fcc41 100644
--- a/audio.c
+++ b/audio.c
@@ -3750,9 +3750,12 @@ void AudioVideoReady(int64_t pts)
skip =
pts - 15 * 20 * 90 - AudioBufferTime * 90 - audio_pts +
VideoAudioDelay;
+#ifdef DEBUG
printf("%dms %dms %dms\n", (int)(pts - audio_pts) / 90,
VideoAudioDelay / 90, skip / 90);
- if (1 && skip > 0) {
+#endif
+ // guard against old PTS
+ if (skip> 0 && skip < 2000 * 90) {
skip = (((int64_t) skip * AudioRing[AudioRingWrite].HwSampleRate)
/ (1000 * 90))
* AudioRing[AudioRingWrite].HwChannels * AudioBytesProSample;