aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDale Curtis <dalecurtis@chromium.org>2020-05-14 14:38:07 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-03 12:10:24 +0200
commitf377de64131391e0ded0d52b51ecd60eaddd81c7 (patch)
treef2bdace8c4952a04361fba34e5c1dfde5829c76e
parent4fdf23df7d2607be23445a044f68798e6448d2fa (diff)
downloadffmpeg-f377de64131391e0ded0d52b51ecd60eaddd81c7.tar.gz
avformat/mov: Check if DTS is AV_NOPTS_VALUE in mov_find_next_sample().
Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit bf446711bc8b7f316771870b8d4dc4dd65f5d94b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index ae33ba382c..71af75764e 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7630,7 +7630,7 @@ static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st)
av_log(s, AV_LOG_TRACE, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
if (!sample || (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL) && current_sample->pos < sample->pos) ||
((s->pb->seekable & AVIO_SEEKABLE_NORMAL) &&
- ((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb &&
+ ((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb && dts != AV_NOPTS_VALUE &&
((FFABS(best_dts - dts) <= AV_TIME_BASE && current_sample->pos < sample->pos) ||
(FFABS(best_dts - dts) > AV_TIME_BASE && dts < best_dts)))))) {
sample = current_sample;