summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demux/demux.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 42d083fea3..6070fd74a8 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -2131,7 +2131,7 @@ static struct demux_packet *find_seek_target(struct demux_queue *queue,
if (diff > 0)
continue;
}
- if (target_diff != MP_NOPTS_VALUE) {
+ if (target) {
if (diff <= 0) {
if (target_diff <= 0 && diff <= target_diff)
continue;
@@ -2140,6 +2140,8 @@ static struct demux_packet *find_seek_target(struct demux_queue *queue,
}
target_diff = diff;
target = dp;
+ if (range_pts > pts)
+ break;
}
return target;