提交 a4f97be1 编写于 作者: M Martin Storsjö

hls: Reset the AVIOContext when seeking

This avoids reading any old data in the AVIOContext buffer after
the seek, and indicates to the mpegts demuxer that we've seeked,
avoiding continuity check errors.
Signed-off-by: NMartin Storsjö <martin@martin.st>
上级 55fd7da1
......@@ -708,6 +708,10 @@ static int hls_read_seek(AVFormatContext *s, int stream_index,
av_free_packet(&var->pkt);
reset_packet(&var->pkt);
var->pb.eof_reached = 0;
/* Clear any buffered data */
var->pb.buf_end = var->pb.buf_ptr = var->pb.buffer;
/* Reset the pos, to let the mpegts demuxer know we've seeked. */
var->pb.pos = 0;
/* Locate the segment that contains the target timestamp */
for (j = 0; j < var->n_segments; j++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册