mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 19:51:49 +08:00
程序退出前停止一切录制
This commit is contained in:
@@ -206,6 +206,11 @@ public:
|
||||
_recorder_map.erase(getRecorderKey(vhost, app, stream_id));
|
||||
}
|
||||
|
||||
void stopAll(){
|
||||
lock_guard<decltype(_recorder_mtx)> lck(_recorder_mtx);
|
||||
_recorder_map.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
MediaSourceWatcher(){
|
||||
NoticeCenter::Instance().addListener(this,Broadcast::kBroadcastMediaChanged,[this](BroadcastMediaChangedArgs){
|
||||
@@ -352,4 +357,9 @@ void Recorder::stopRecord(Recorder::type type, const string &vhost, const string
|
||||
}
|
||||
}
|
||||
|
||||
void Recorder::stopAll() {
|
||||
MediaSourceWatcher<type_hls>::Instance().stopAll();
|
||||
MediaSourceWatcher<type_mp4>::Instance().stopAll();
|
||||
}
|
||||
|
||||
} /* namespace mediakit */
|
||||
|
||||
Reference in New Issue
Block a user