diff options
author | Clément Bœsch <u@pkh.me> | 2013-09-08 09:55:02 +0200 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2013-09-08 12:54:49 +0200 |
commit | 1ca4bf930bab681a79fb591330043675c7cfd798 (patch) | |
tree | e95d801cab6d0014b37edc50de86ee38806d96f1 | |
parent | f8678dcef3c5b0ea82e898e1f419863409fa135f (diff) | |
download | ffmpeg-1ca4bf930bab681a79fb591330043675c7cfd798.tar.gz |
avformat/subtitles: check lower bound for duration overlap seeking.
-rw-r--r-- | libavformat/subtitles.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c index b6d335c6e2..b796f4062c 100644 --- a/libavformat/subtitles.c +++ b/libavformat/subtitles.c @@ -122,10 +122,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; |