aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2013-09-08 09:55:02 +0200
committerClément Bœsch <u@pkh.me>2013-09-10 21:39:16 +0200
commit6a782e20d7613f91f637630c3b9158f8c6e549c1 (patch)
treee2aa1e5ee601d8fdfb90791cf5571725be2ad876 /libavformat
parent8cea63c48ae004b240a925bcbd882985928149bd (diff)
downloadffmpeg-6a782e20d7613f91f637630c3b9158f8c6e549c1.tar.gz
avformat/subtitles: check lower bound for duration overlap seeking.
(cherry picked from commit 1ca4bf930bab681a79fb591330043675c7cfd798)
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/subtitles.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c
index e128bcef3e..1634e3a99a 100644
--- a/libavformat/subtitles.c
+++ b/libavformat/subtitles.c
@@ -119,10 +119,11 @@ int ff_subtitles_queue_seek(FFDemuxSubtitlesQueue *q, AVFormatContext *s, int st
/* look back in the latest subtitles for overlapping subtitles */
ts_selected = q->subs[idx].pts;
for (i = idx - 1; i >= 0; i--) {
+ int64_t pts = q->subs[i].pts;
if (q->subs[i].duration <= 0 ||
(stream_index != -1 && q->subs[i].stream_index != stream_index))
continue;
- if (q->subs[i].pts > ts_selected - q->subs[i].duration)
+ if (pts >= min_ts && pts > ts_selected - q->subs[i].duration)
idx = i;
else
break;