mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 22:55:52 +08:00
延迟清空状态
This commit is contained in:
parent
c445ad2cdf
commit
d879c5901d
@ -133,7 +133,7 @@ void RtmpPlayer::onPlayResult_l(const SockException &ex, bool handshake_done) {
|
|||||||
//创建rtmp数据接收超时检测定时器
|
//创建rtmp数据接收超时检测定时器
|
||||||
_rtmp_recv_timer = std::make_shared<Timer>(timeout_ms / 2000.0, lam, getPoller());
|
_rtmp_recv_timer = std::make_shared<Timer>(timeout_ms / 2000.0, lam, getPoller());
|
||||||
} else {
|
} else {
|
||||||
teardown();
|
shutdown(SockException(Err_shutdown,"teardown"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ void RtmpPusher::onPublishResult(const SockException &ex, bool handshake_done) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ex) {
|
if (ex) {
|
||||||
teardown();
|
shutdown(SockException(Err_shutdown,"teardown"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,12 +26,17 @@ RtspPusher::~RtspPusher() {
|
|||||||
DebugL << endl;
|
DebugL << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtspPusher::teardown() {
|
void RtspPusher::sendTeardown(){
|
||||||
if (alive()) {
|
if (alive()) {
|
||||||
|
if (!_content_base.empty()) {
|
||||||
sendRtspRequest("TEARDOWN", _content_base);
|
sendRtspRequest("TEARDOWN", _content_base);
|
||||||
|
}
|
||||||
shutdown(SockException(Err_shutdown, "teardown"));
|
shutdown(SockException(Err_shutdown, "teardown"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RtspPusher::teardown() {
|
||||||
|
sendTeardown();
|
||||||
reset();
|
reset();
|
||||||
CLEAR_ARR(_udp_socks);
|
CLEAR_ARR(_udp_socks);
|
||||||
_nonce.clear();
|
_nonce.clear();
|
||||||
@ -107,7 +112,7 @@ void RtspPusher::onPublishResult(const SockException &ex, bool handshake_done) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ex) {
|
if (ex) {
|
||||||
teardown();
|
sendTeardown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ private:
|
|||||||
void sendSetup(unsigned int track_idx);
|
void sendSetup(unsigned int track_idx);
|
||||||
void sendRecord();
|
void sendRecord();
|
||||||
void sendOptions();
|
void sendOptions();
|
||||||
|
void sendTeardown();
|
||||||
|
|
||||||
void handleResAnnounce(const Parser &parser);
|
void handleResAnnounce(const Parser &parser);
|
||||||
void handleResSetup(const Parser &parser, unsigned int track_idx);
|
void handleResSetup(const Parser &parser, unsigned int track_idx);
|
||||||
|
Loading…
Reference in New Issue
Block a user