mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 12:11:36 +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() {
|
RtpSession::~RtpSession() = default;
|
||||||
if (_process) {
|
|
||||||
RtpSelector::Instance().delProcess(_stream_id, _process.get());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void RtpSession::onRecv(const Buffer::Ptr &data) {
|
void RtpSession::onRecv(const Buffer::Ptr &data) {
|
||||||
if (_is_udp) {
|
if (_is_udp) {
|
||||||
@ -62,6 +58,9 @@ void RtpSession::onRecv(const Buffer::Ptr &data) {
|
|||||||
|
|
||||||
void RtpSession::onError(const SockException &err) {
|
void RtpSession::onError(const SockException &err) {
|
||||||
WarnP(this) << _stream_id << " " << err;
|
WarnP(this) << _stream_id << " " << err;
|
||||||
|
if (_process) {
|
||||||
|
RtpSelector::Instance().delProcess(_stream_id, _process.get());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtpSession::onManager() {
|
void RtpSession::onManager() {
|
||||||
|
Loading…
Reference in New Issue
Block a user