Commit eada079e authored by Jun Zhao's avatar Jun Zhao Committed by Steven Liu

lavf/hls: drop unnecessary check before ff_format_io_close

ff_format_io_close will check the AVIOContext pointer pb, so drop
the unnecessary check before ff_format_io_close.
Reviewed-by: 's avatarSteven Liu <lq@onvideo.cn>
Signed-off-by: 's avatarJun Zhao <barryjzhao@tencent.com>
parent 48d96ce2
......@@ -254,10 +254,8 @@ static void free_playlist_list(HLSContext *c)
av_freep(&pls->init_sec_buf);
av_packet_unref(&pls->pkt);
av_freep(&pls->pb.buffer);
if (pls->input)
ff_format_io_close(c->ctx, &pls->input);
pls->input_read_done = 0;
if (pls->input_next)
ff_format_io_close(c->ctx, &pls->input_next);
pls->input_next_requested = 0;
if (pls->ctx) {
......@@ -2006,10 +2004,8 @@ static int recheck_discard_flags(AVFormatContext *s, int first)
}
av_log(s, AV_LOG_INFO, "Now receiving playlist %d, segment %d\n", i, pls->cur_seq_no);
} else if (first && !cur_needed && pls->needed) {
if (pls->input)
ff_format_io_close(pls->parent, &pls->input);
pls->input_read_done = 0;
if (pls->input_next)
ff_format_io_close(pls->parent, &pls->input_next);
pls->input_next_requested = 0;
pls->needed = 0;
......@@ -2251,10 +2247,8 @@ static int hls_read_seek(AVFormatContext *s, int stream_index,
for (i = 0; i < c->n_playlists; i++) {
/* Reset reading */
struct playlist *pls = c->playlists[i];
if (pls->input)
ff_format_io_close(pls->parent, &pls->input);
pls->input_read_done = 0;
if (pls->input_next)
ff_format_io_close(pls->parent, &pls->input_next);
pls->input_next_requested = 0;
av_packet_unref(&pls->pkt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment