mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 04:08:57 +08:00
BugFix: MediaSource unregister after 3 seconds after calling close_streams (#3132)
To avoid frequent creation and destruction of UdpSession, RtpSession will be destructed 3 seconds after triggering onError.
This commit is contained in:
parent
c0bb7db476
commit
a72d87cca7
@ -46,11 +46,7 @@ RtpSession::RtpSession(const Socket::Ptr &sock)
|
||||
}
|
||||
}
|
||||
|
||||
RtpSession::~RtpSession() {
|
||||
if (_process) {
|
||||
RtpSelector::Instance().delProcess(_stream_id, _process.get());
|
||||
}
|
||||
}
|
||||
RtpSession::~RtpSession() = default;
|
||||
|
||||
void RtpSession::onRecv(const Buffer::Ptr &data) {
|
||||
if (_is_udp) {
|
||||
@ -62,6 +58,9 @@ void RtpSession::onRecv(const Buffer::Ptr &data) {
|
||||
|
||||
void RtpSession::onError(const SockException &err) {
|
||||
WarnP(this) << _stream_id << " " << err;
|
||||
if (_process) {
|
||||
RtpSelector::Instance().delProcess(_stream_id, _process.get());
|
||||
}
|
||||
}
|
||||
|
||||
void RtpSession::onManager() {
|
||||
|
Loading…
Reference in New Issue
Block a user