修复文件写缓存提前销毁的问题:#196

This commit is contained in:
xiongziliang 2019-12-27 15:36:54 +08:00
parent 37bca15dc9
commit 291969aee6

View File

@ -103,7 +103,8 @@ void HlsMakerImp::onWriteHls(const char *data, int len) {
std::shared_ptr<FILE> HlsMakerImp::makeFile(const string &file,bool setbuf) {
auto ret= shared_ptr<FILE>(File::createfile_file(file.data(), "wb"), [](FILE *fp) {
auto file_buf = _file_buf;
auto ret= shared_ptr<FILE>(File::createfile_file(file.data(), "wb"), [file_buf](FILE *fp) {
if (fp) {
fclose(fp);
}