Message ID | CADxeRw=jMKd4VMbhpK5yra=APOR-JU5XJHesUZeov2SrMO4XUA@mail.gmail.com |
---|---|
State | Accepted |
Headers | show |
On Tue, Aug 30, 2016 at 05:30:18PM +0800, Steven Liu wrote: > When use append_list mode, the hls_init_time set nouse, > Because the append_list only support append at the old m3u8 end > cannot set init segments durations at the middle of the list. > That's invalid use append_list and hls_init_time one time. > and show a warning message for user. > > Signed-off-by: LiuQi <liuqi@gosun.com> > --- > libavformat/hlsenc.c | 6 ++++++ > 1 file changed, 6 insertions(+) applied thx [...]
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index ab4a9bf..b08f7ec 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -812,6 +812,12 @@ static int hls_write_header(AVFormatContext *s) if (hls->flags & HLS_APPEND_LIST) { parse_playlist(s, s->filename); + if (hls->init_time > 0) { + av_log(s, AV_LOG_WARNING, "append_list mode cannot set hls_init_time," + "this is append to the endlist of the old m3u8\n"); + hls->init_time = 0; + hls->recording_time = hls->time * AV_TIME_BASE; + } }
When use append_list mode, the hls_init_time set nouse, Because the append_list only support append at the old m3u8 end cannot set init segments durations at the middle of the list. That's invalid use append_list and hls_init_time one time. and show a warning message for user. Signed-off-by: LiuQi <liuqi@gosun.com> --- libavformat/hlsenc.c | 6 ++++++ 1 file changed, 6 insertions(+) if ((ret = hls_start(s)) < 0) -- 2.7.4 (Apple Git-66)