mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-03 08:57:32 +08:00
防止对象析构时抛异常导致的崩溃
This commit is contained in:
@@ -48,7 +48,13 @@ public:
|
||||
*/
|
||||
RtmpMediaSource(const MediaTuple& tuple, int ring_size = RTMP_GOP_SIZE): MediaSource(RTMP_SCHEMA, tuple), _ring_size(ring_size) {}
|
||||
|
||||
~RtmpMediaSource() override { flush(); }
|
||||
~RtmpMediaSource() override {
|
||||
try {
|
||||
flush();
|
||||
} catch (std::exception &ex) {
|
||||
WarnL << ex.what();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取媒体源的环形缓冲
|
||||
|
||||
Reference in New Issue
Block a user