Message ID | 20230815205330.56868-1-timo@rothenpieler.org |
---|---|
State | Accepted |
Commit | f225f8d7464569c7b917015c26ad30a37a5fbbe2 |
Headers | show |
Series | [FFmpeg-devel] avformat/hls: reset the playlist init segment on seek | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
On 15.08.2023 22:53, Timo Rothenpieler wrote: > The mp4 demuxer gets very upset when it gets flushed and not re-fed this > data. > --- > libavformat/hls.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libavformat/hls.c b/libavformat/hls.c > index 2a2fe28a54..c625e30291 100644 > --- a/libavformat/hls.c > +++ b/libavformat/hls.c > @@ -2506,6 +2506,9 @@ static int hls_read_seek(AVFormatContext *s, int stream_index, > /* Flush the packet queue of the subdemuxer. */ > ff_read_frame_flush(pls->ctx); > > + /* Reset the init segment so it's re-fetched and served appropiately */ > + pls->cur_init_section = NULL; > + > pls->seek_timestamp = seek_timestamp; > pls->seek_flags = flags; > Would appreciate some quick review on this, since I'm not super familiar with the HLS code. It works fine and looks correct to me though, so if nobody does, I'll apply this in a couple days.
diff --git a/libavformat/hls.c b/libavformat/hls.c index 2a2fe28a54..c625e30291 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -2506,6 +2506,9 @@ static int hls_read_seek(AVFormatContext *s, int stream_index, /* Flush the packet queue of the subdemuxer. */ ff_read_frame_flush(pls->ctx); + /* Reset the init segment so it's re-fetched and served appropiately */ + pls->cur_init_section = NULL; + pls->seek_timestamp = seek_timestamp; pls->seek_flags = flags;