[FFmpeg-devel] [PATCH] libavformat/hls.c: fix hls_read_seek return error when seek to first_timestamp
1433100204 at qq.com
1433100204 at qq.com
Tue Sep 17 16:00:52 EEST 2019
From: leizhai <leizhai at sohu-inc.com>
---
libavformat/hls.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 0611ddc6bb..4525862ee8 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -2237,7 +2237,12 @@ static int hls_read_seek(AVFormatContext *s, int stream_index,
}
/* check if the timestamp is valid for the playlist with the
* specified stream index */
- if (!seek_pls || !find_timestamp_in_playlist(c, seek_pls, seek_timestamp, &seq_no))
+
+ /*fix seek to first_timestamp return error bug*/
+ int find_ts_ret = find_timestamp_in_playlist(c, seek_pls, seek_timestamp, &seq_no);
+ if (find_ts_ret == 0 && seq_no == seek_pls->start_seq_no)
+ find_ts_ret = 1;
+ if (!seek_pls || !find_ts_ret)
return AVERROR(EIO);
/* set segment now so we do not need to search again below */
--
2.14.3 (Apple Git-98)
More information about the ffmpeg-devel
mailing list