diff --git a/src/Record/MP4Recorder.cpp b/src/Record/MP4Recorder.cpp index 5373b8a1..59a0d590 100644 --- a/src/Record/MP4Recorder.cpp +++ b/src/Record/MP4Recorder.cpp @@ -34,8 +34,12 @@ MP4Recorder::MP4Recorder(const string &path, const string &vhost, const string & } MP4Recorder::~MP4Recorder() { - flush(); - closeFile(); + try { + flush(); + closeFile(); + } catch (std::exception &ex) { + WarnL << ex.what(); + } } void MP4Recorder::createFile() { diff --git a/src/TS/TSMediaSourceMuxer.h b/src/TS/TSMediaSourceMuxer.h index 389ea901..cdf08fbb 100644 --- a/src/TS/TSMediaSourceMuxer.h +++ b/src/TS/TSMediaSourceMuxer.h @@ -26,7 +26,13 @@ public: _media_src = std::make_shared(tuple); } - ~TSMediaSourceMuxer() override { MpegMuxer::flush(); }; + ~TSMediaSourceMuxer() override { + try { + MpegMuxer::flush(); + } catch (std::exception &ex) { + WarnL << ex.what(); + } + }; void setListener(const std::weak_ptr &listener){ setDelegate(listener);