mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-19 16:27:50 +08:00
Compare commits
2 Commits
fd4f00dd63
...
56fe66da7c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56fe66da7c | ||
|
|
026e74d624 |
@ -341,10 +341,14 @@ void FFmpegSource::onGetMediaSource(const MediaSource::Ptr &src) {
|
||||
setDelegate(listener);
|
||||
muxer->setDelegate(shared_from_this());
|
||||
if (_enable_hls) {
|
||||
src->setupRecord(Recorder::type_hls, true, "", 0);
|
||||
src->getOwnerPoller()->async([=]() mutable {
|
||||
src->setupRecord(Recorder::type_hls, true, "", 0);
|
||||
});
|
||||
}
|
||||
if (_enable_mp4) {
|
||||
src->setupRecord(Recorder::type_mp4, true, "", 0);
|
||||
src->getOwnerPoller()->async([=]() mutable {
|
||||
src->setupRecord(Recorder::type_mp4, true, "", 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,6 +194,13 @@ static std::shared_ptr<char> getSharedMmap(const string &file_path, int64_t &fil
|
||||
}
|
||||
|
||||
HttpFileBody::HttpFileBody(const string &file_path, bool use_mmap) {
|
||||
|
||||
// 判断是否为目录,避免对目录进行mmap操作,导致程序崩溃。
|
||||
if (File::is_dir(file_path)) {
|
||||
_read_to = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (use_mmap ) {
|
||||
_map_addr = getSharedMmap(file_path, _read_to);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user