[FFmpeg-cvslog] avformat/dhav: check if timestamp matches when seeking

Paul B Mahol git at videolan.org
Wed Oct 13 13:16:01 EEST 2021


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Oct 13 11:46:15 2021 +0200| [6384175d8c33989814f3a5ec9aeb54f1025044b6] | committer: Paul B Mahol

avformat/dhav: check if timestamp matches when seeking

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6384175d8c33989814f3a5ec9aeb54f1025044b6
---

 libavformat/dhav.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/dhav.c b/libavformat/dhav.c
index f67b0b89ac..4d45a258d8 100644
--- a/libavformat/dhav.c
+++ b/libavformat/dhav.c
@@ -439,11 +439,12 @@ static int dhav_read_seek(AVFormatContext *s, int stream_index,
 
     if (index < 0)
         return -1;
+    pts = sti->index_entries[index].timestamp;
+    if (pts < timestamp)
+        return AVERROR(EAGAIN);
     if (avio_seek(s->pb, sti->index_entries[index].pos, SEEK_SET) < 0)
         return -1;
 
-    pts = sti->index_entries[index].timestamp;
-
     for (int n = 0; n < s->nb_streams; n++) {
         AVStream *st = s->streams[n];
         DHAVStream *dst = st->priv_data;
@@ -465,5 +466,5 @@ const AVInputFormat ff_dhav_demuxer = {
     .read_packet    = dhav_read_packet,
     .read_seek      = dhav_read_seek,
     .extensions     = "dav",
-    .flags          = AVFMT_GENERIC_INDEX | AVFMT_NO_BYTE_SEEK | AVFMT_TS_DISCONT | AVFMT_TS_NONSTRICT,
+    .flags          = AVFMT_GENERIC_INDEX | AVFMT_NO_BYTE_SEEK | AVFMT_TS_DISCONT | AVFMT_TS_NONSTRICT | AVFMT_SEEK_TO_PTS,
 };



More information about the ffmpeg-cvslog mailing list