update plugins/publish/publish_node.cpp
This commit is contained in:
parent
a8566b9c88
commit
d98d2e0f2e
@ -96,10 +96,15 @@ public:
|
||||
av_dict_set(&opts, "hls_time", seg.c_str(), 0);
|
||||
av_dict_set(&opts, "hls_list_size", "0", 0);
|
||||
av_dict_set(&opts, "hls_flags", "delete_segments+append_list", 0);
|
||||
// Ensure HLS output directory exists (HLS muxer uses AVFMT_NOFILE)
|
||||
std::filesystem::path p(url_);
|
||||
if (!p.has_extension()) p /= "index.m3u8";
|
||||
std::error_code ec;
|
||||
std::filesystem::create_directories(p.parent_path(), ec);
|
||||
}
|
||||
|
||||
// For RTSP server, let libavformat handle the listening socket in write_header.
|
||||
if (proto_ == "hls" && !(fmt_->oformat->flags & AVFMT_NOFILE)) {
|
||||
// For non-NOFILE formats, open IO context manually.
|
||||
if (!(fmt_->oformat->flags & AVFMT_NOFILE)) {
|
||||
if (av_io_open(url_, opts) < 0) {
|
||||
av_dict_free(&opts);
|
||||
Close();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user