mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
防止析构时抛异常导致的崩溃
This commit is contained in:
parent
9f28384cd9
commit
2206b031a9
@ -34,8 +34,12 @@ MP4Recorder::MP4Recorder(const string &path, const string &vhost, const string &
|
|||||||
}
|
}
|
||||||
|
|
||||||
MP4Recorder::~MP4Recorder() {
|
MP4Recorder::~MP4Recorder() {
|
||||||
flush();
|
try {
|
||||||
closeFile();
|
flush();
|
||||||
|
closeFile();
|
||||||
|
} catch (std::exception &ex) {
|
||||||
|
WarnL << ex.what();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MP4Recorder::createFile() {
|
void MP4Recorder::createFile() {
|
||||||
|
@ -26,7 +26,13 @@ public:
|
|||||||
_media_src = std::make_shared<TSMediaSource>(tuple);
|
_media_src = std::make_shared<TSMediaSource>(tuple);
|
||||||
}
|
}
|
||||||
|
|
||||||
~TSMediaSourceMuxer() override { MpegMuxer::flush(); };
|
~TSMediaSourceMuxer() override {
|
||||||
|
try {
|
||||||
|
MpegMuxer::flush();
|
||||||
|
} catch (std::exception &ex) {
|
||||||
|
WarnL << ex.what();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void setListener(const std::weak_ptr<MediaSourceEvent> &listener){
|
void setListener(const std::weak_ptr<MediaSourceEvent> &listener){
|
||||||
setDelegate(listener);
|
setDelegate(listener);
|
||||||
|
Loading…
Reference in New Issue
Block a user