diff options
author | Anssi Hannula <anssi.hannula@iki.fi> | 2014-01-03 13:52:20 +0200 |
---|---|---|
committer | Anssi Hannula <anssi.hannula@iki.fi> | 2014-04-06 17:55:04 +0300 |
commit | f29cb45bf2cf3748968959a37174675bd917bf1c (patch) | |
tree | 81d693e654de25fbf9a9d374647066f747ec7a82 | |
parent | 9aa0606e87a221eba935ed675c1cd5ca94832e28 (diff) | |
download | ffmpeg-f29cb45bf2cf3748968959a37174675bd917bf1c.tar.gz |
avformat/hls: flush the subdemuxer when seeking
Since we are basically seeking the AVIOContext under the subdemuxer, we
need to flush the subdemuxer to avoid old packets from being read from
the packet queue after the seek.
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
-rw-r--r-- | libavformat/hls.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c index e4770ab33b..e50220b0b2 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -1629,6 +1629,8 @@ static int hls_read_seek(AVFormatContext *s, int stream_index, pls->pb.buf_end = pls->pb.buf_ptr = pls->pb.buffer; /* Reset the pos, to let the mpegts demuxer know we've seeked. */ pls->pb.pos = 0; + /* Flush the packet queue of the subdemuxer. */ + ff_read_frame_flush(pls->ctx); pls->seek_timestamp = seek_timestamp; pls->seek_flags = flags; |