@@ -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 */
From: leizhai <leizhai@sohu-inc.com> --- libavformat/hls.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)