hls: fix seeking to timestamps earlier then the playlist start
Instead of failing, seek to the start of the playlist.
This commit is contained in:
parent
b2a2745b57
commit
9b91eb7ebc
|
@ -2454,6 +2454,10 @@ static int hls_read_seek(AVFormatContext *s, int stream_index,
|
|||
duration = s->duration == AV_NOPTS_VALUE ?
|
||||
0 : s->duration;
|
||||
|
||||
/* bound seeking to the beginning of the stream */
|
||||
if (seek_timestamp < first_timestamp)
|
||||
seek_timestamp = first_timestamp;
|
||||
|
||||
if (0 < duration && duration < seek_timestamp - first_timestamp)
|
||||
return AVERROR(EIO);
|
||||
|
||||
|
|
Loading…
Reference in New Issue