summaryrefslogtreecommitdiffstats
path: root/libavformat/hls.c
diff options
context:
space:
mode:
authorJun Zhao <barryjzhao@tencent.com>2019-09-13 19:53:35 +0800
committerSteven Liu <lq@chinaffmpeg.org>2019-09-14 10:00:12 +0800
commiteada079e718f57f94a61d7331e09931e03cb4229 (patch)
tree2c422931553e03c8369642c86bab824a1a0f05a6 /libavformat/hls.c
parent48d96ce29a2dc459bc844e284322c6bd00cd3f2f (diff)
downloadffmpeg-streaming-eada079e718f57f94a61d7331e09931e03cb4229.zip
ffmpeg-streaming-eada079e718f57f94a61d7331e09931e03cb4229.tar.gz
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: Steven Liu <lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'libavformat/hls.c')
-rw-r--r--libavformat/hls.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 10fc568..b32940b 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -254,11 +254,9 @@ 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);
+ 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);
+ ff_format_io_close(c->ctx, &pls->input_next);
pls->input_next_requested = 0;
if (pls->ctx) {
pls->ctx->pb = NULL;
@@ -2006,11 +2004,9 @@ 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);
+ 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);
+ ff_format_io_close(pls->parent, &pls->input_next);
pls->input_next_requested = 0;
pls->needed = 0;
changed = 1;
@@ -2251,11 +2247,9 @@ 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);
+ 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);
+ ff_format_io_close(pls->parent, &pls->input_next);
pls->input_next_requested = 0;
av_packet_unref(&pls->pkt);
pls->pb.eof_reached = 0;
OpenPOWER on IntegriCloud