mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
防止未开启录制功能时,使用该功能导致的bug
This commit is contained in:
parent
2b3ce0ec63
commit
827158af73
@ -64,19 +64,21 @@ std::shared_ptr<MediaSinkInterface> Recorder::createRecorder(type type, const st
|
||||
auto ret = std::make_shared<HlsRecorder>(path, enable_vhost ? string(VHOST_KEY) + "=" + vhost : "");
|
||||
ret->setMediaSource(vhost, app, stream_id);
|
||||
return ret;
|
||||
#else
|
||||
throw std::invalid_argument("hls相关功能未打开,请开启ENABLE_HLS宏后编译再测试");
|
||||
#endif
|
||||
return nullptr;
|
||||
|
||||
}
|
||||
|
||||
case Recorder::type_mp4: {
|
||||
#if defined(ENABLE_MP4)
|
||||
return std::make_shared<MP4Recorder>(path, vhost, app, stream_id);
|
||||
#else
|
||||
throw std::invalid_argument("mp4相关功能未打开,请开启ENABLE_MP4宏后编译再测试");
|
||||
#endif
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
default:
|
||||
return nullptr;
|
||||
default: throw std::invalid_argument("未知的录制类型");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user