Skip to content
Snippets Groups Projects
Commit 1c103100 authored by Steven Liu's avatar Steven Liu
Browse files

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: default avatarSteven Liu <lq@chinaffmpeg.org>
parent 8a1759ad
No related branches found
No related tags found
No related merge requests found
...@@ -300,6 +300,7 @@ static int hls_delete_old_segments(HLSContext *hls) { ...@@ -300,6 +300,7 @@ static int hls_delete_old_segments(HLSContext *hls) {
av_dict_set(&options, "method", "DELETE", 0); av_dict_set(&options, "method", "DELETE", 0);
if ((ret = hls->avf->io_open(hls->avf, &out, path, AVIO_FLAG_WRITE, &options)) < 0) if ((ret = hls->avf->io_open(hls->avf, &out, path, AVIO_FLAG_WRITE, &options)) < 0)
goto fail; goto fail;
ff_format_io_close(hls->avf, &out);
} else if (unlink(path) < 0) { } else if (unlink(path) < 0) {
av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n", av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n",
path, strerror(errno)); path, strerror(errno));
...@@ -322,6 +323,7 @@ static int hls_delete_old_segments(HLSContext *hls) { ...@@ -322,6 +323,7 @@ static int hls_delete_old_segments(HLSContext *hls) {
av_free(sub_path); av_free(sub_path);
goto fail; goto fail;
} }
ff_format_io_close(hls->avf, &out);
} else if (unlink(sub_path) < 0) { } else if (unlink(sub_path) < 0) {
av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n", av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n",
sub_path, strerror(errno)); sub_path, strerror(errno));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment