summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2012-06-27 21:22:25 +0200
committerJohns <johns98@gmx.net>2012-06-27 21:22:25 +0200
commit6aa8601f7d0734f3088b0a5bac26d4e86db85f32 (patch)
tree61cc6007e3857c21dcdb63c84dd02edc0ec97ec0
parent0f62a521f41a44212507539a2417c28f74169491 (diff)
downloadvdr-plugin-softhddevice-6aa8601f7d0734f3088b0a5bac26d4e86db85f32.tar.gz
vdr-plugin-softhddevice-6aa8601f7d0734f3088b0a5bac26d4e86db85f32.tar.bz2
Guard audio skip against old PTS values.
-rw-r--r--ChangeLog2
-rw-r--r--audio.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a70fded..c36ab12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@ User johns
Date:
Release Version 0.5.1
+ Guard audio skip against old PTS values.
+ Improved audio skip, after channel switch.
Setup add preview of collapsed tree.
Fix bug: dvd plugin times out.
Makes OSD size configurable.
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;