diff options
author | Steven Liu <lq@chinaffmpeg.org> | 2017-01-20 12:12:02 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2017-01-20 12:12:02 +0800 |
commit | 1c1031003b053e819185881ba512ebdffdbf637f (patch) | |
tree | 74362645f27ee7071e8bbd50afc076dcabe6dcd7 | |
parent | 8a1759ad46f05375c957f33049b4592befbcb224 (diff) | |
download | ffmpeg-1c1031003b053e819185881ba512ebdffdbf637f.tar.gz |
avformat/hlsenc: fix too many open files bug
When use http method to delete the old segments,
there is only io_open, hove not io_close yet,
this patch is used to fix it
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
-rw-r--r-- | libavformat/hlsenc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 1f4bf8b53d..85d39551e2 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -300,6 +300,7 @@ static int hls_delete_old_segments(HLSContext *hls) { av_dict_set(&options, "method", "DELETE", 0); if ((ret = hls->avf->io_open(hls->avf, &out, path, AVIO_FLAG_WRITE, &options)) < 0) goto fail; + ff_format_io_close(hls->avf, &out); } else if (unlink(path) < 0) { av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n", path, strerror(errno)); @@ -322,6 +323,7 @@ static int hls_delete_old_segments(HLSContext *hls) { av_free(sub_path); goto fail; } + ff_format_io_close(hls->avf, &out); } else if (unlink(sub_path) < 0) { av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n", sub_path, strerror(errno)); |