summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2012-02-14 16:03:08 +0100
committerJohns <johns98@gmx.net>2012-02-14 16:03:08 +0100
commit4331692ee5b915e588910d62b6b9244d56c9ab8c (patch)
tree43cad231cb8521153c46cf042c8f711ebb501e93
parent5aa826bdb0b4de4cab0dd69b62bb36074e072bc5 (diff)
downloadvdr-plugin-softhddevice-4331692ee5b915e588910d62b6b9244d56c9ab8c.tar.gz
vdr-plugin-softhddevice-4331692ee5b915e588910d62b6b9244d56c9ab8c.tar.bz2
Fix bug: audio increments invalid audio PTS.
-rw-r--r--ChangeLog1
-rw-r--r--audio.c16
2 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 24679b5..debacf5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
User johns
+ Fix bug: audio increments invalid audio PTS.
Fix bug: dvd plugin not working.
Fix bug: used frame-> instead of video_ctx-> for old libav/ffmpeg.
diff --git a/audio.c b/audio.c
index 5d470f6..f7c208a 100644
--- a/audio.c
+++ b/audio.c
@@ -290,9 +290,11 @@ static int AlsaAddToRingbuffer(const void *samples, int count)
// FIXME: should skip more, longer skip, but less often?
}
// Update audio clock
- AudioPTS +=
- ((int64_t) count * 90000) / (AudioSampleRate * AudioChannels *
- AudioBytesProSample);
+ if (AudioPTS != INT64_C(0x8000000000000000)) {
+ AudioPTS +=
+ ((int64_t) count * 90000) / (AudioSampleRate * AudioChannels *
+ AudioBytesProSample);
+ }
if (!AudioRunning) {
if (AlsaStartThreshold < RingBufferUsedBytes(AlsaRingBuffer)) {
@@ -1275,9 +1277,11 @@ static int OssAddToRingbuffer(const void *samples, int count)
// FIXME: should skip more, longer skip, but less often?
}
// Update audio clock
- AudioPTS +=
- ((int64_t) count * 90000) / (AudioSampleRate * AudioChannels *
- AudioBytesProSample);
+ if (AudioPTS != INT64_C(0x8000000000000000)) {
+ AudioPTS +=
+ ((int64_t) count * 90000) / (AudioSampleRate * AudioChannels *
+ AudioBytesProSample);
+ }
if (!AudioRunning) {
if (OssStartThreshold < RingBufferUsedBytes(OssRingBuffer)) {