mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 08:39:34 +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 : "");
|
auto ret = std::make_shared<HlsRecorder>(path, enable_vhost ? string(VHOST_KEY) + "=" + vhost : "");
|
||||||
ret->setMediaSource(vhost, app, stream_id);
|
ret->setMediaSource(vhost, app, stream_id);
|
||||||
return ret;
|
return ret;
|
||||||
|
#else
|
||||||
|
throw std::invalid_argument("hls相关功能未打开,请开启ENABLE_HLS宏后编译再测试");
|
||||||
#endif
|
#endif
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case Recorder::type_mp4: {
|
case Recorder::type_mp4: {
|
||||||
#if defined(ENABLE_MP4)
|
#if defined(ENABLE_MP4)
|
||||||
return std::make_shared<MP4Recorder>(path, vhost, app, stream_id);
|
return std::make_shared<MP4Recorder>(path, vhost, app, stream_id);
|
||||||
|
#else
|
||||||
|
throw std::invalid_argument("mp4相关功能未打开,请开启ENABLE_MP4宏后编译再测试");
|
||||||
#endif
|
#endif
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default: throw std::invalid_argument("未知的录制类型");
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user