summaryrefslogtreecommitdiff
path: root/video.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2012-01-08 21:46:00 +0100
committerJohns <johns98@gmx.net>2012-01-08 21:46:00 +0100
commitf6df79e8e64632314c72d85c2410141ab68bff1e (patch)
tree145e90a504d60f50e7e3b17c15b60096e235f2cb /video.c
parentf1551cd321bdadc69f95a450f2934ad71d3d4a8c (diff)
downloadvdr-plugin-softhddevice-f6df79e8e64632314c72d85c2410141ab68bff1e.tar.gz
vdr-plugin-softhddevice-f6df79e8e64632314c72d85c2410141ab68bff1e.tar.bz2
Improved replay of recordings.
Diffstat (limited to 'video.c')
-rw-r--r--video.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/video.c b/video.c
index ce80a7a..4bf7717 100644
--- a/video.c
+++ b/video.c
@@ -6245,6 +6245,7 @@ enum PixelFormat Video_get_format(VideoHwDecoder * decoder,
static void VideoSetPts(int64_t * pts_p, int interlaced, const AVFrame * frame)
{
int64_t pts;
+ int64_t delta;
// update video clock
if ((uint64_t) * pts_p != AV_NOPTS_VALUE) {
@@ -6259,14 +6260,16 @@ static void VideoSetPts(int64_t * pts_p, int interlaced, const AVFrame * frame)
if (!pts) {
pts = AV_NOPTS_VALUE;
}
- // build a monotonic pts
- if ((uint64_t) * pts_p != AV_NOPTS_VALUE) {
- if (pts - *pts_p < -10 * 90) {
- pts = AV_NOPTS_VALUE;
- }
- }
// libav: sets only pkt_dts which can be 0
if ((uint64_t) pts != AV_NOPTS_VALUE) {
+ // build a monotonic pts
+ if ((uint64_t) * pts_p != AV_NOPTS_VALUE) {
+ delta = pts - *pts_p;
+ // ignore negative jumps
+ if (delta > -300 * 90 && delta < -15 * 90) {
+ return;
+ }
+ }
if (*pts_p != pts) {
Debug(3,
"video: %#012" PRIx64 "->%#012" PRIx64 " %4" PRId64 " pts\n",