mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-06 10:57:50 +08:00
[what][bugfix][rtsp] 修复handleResPAUSE 回调未被正常触发 (#4631)
[what][bugfix][rtsp][https://github.com/ZLMediaKit/ZLMediaKit/issues/4625] 修复handleResPAUSE 回调未被正常触发
This commit is contained in:
parent
d0eeba544a
commit
48c37d4f46
@ -446,7 +446,11 @@ void RtspPlayer::sendOptions() {
|
||||
}
|
||||
|
||||
void RtspPlayer::sendKeepAlive() {
|
||||
_on_response = [](const Parser &parser) {};
|
||||
if (_play_check_timer)
|
||||
{
|
||||
WarnL << "receive RTP packet before handleResPAUSE";
|
||||
}
|
||||
_on_keepalive_reponse = [](const Parser &parser) {};
|
||||
if (_supported_cmd.find("GET_PARAMETER") != _supported_cmd.end()) {
|
||||
// 支持GET_PARAMETER,用此命令保活 [AUTO-TRANSLATED:b45cd737]
|
||||
// Support GET_PARAMETER, use this command to keep alive
|
||||
@ -532,6 +536,10 @@ void RtspPlayer::onWholeRtspPacket(Parser &parser) {
|
||||
try {
|
||||
decltype(_on_response) func;
|
||||
_on_response.swap(func);
|
||||
if (!func)
|
||||
{
|
||||
_on_keepalive_reponse.swap(func);
|
||||
}
|
||||
if (func) {
|
||||
func(parser);
|
||||
}
|
||||
|
||||
@ -162,6 +162,7 @@ private:
|
||||
float _speed = 0.0f;
|
||||
std::vector<SdpTrack::Ptr> _sdp_track;
|
||||
std::function<void(const Parser&)> _on_response;
|
||||
std::function<void(const Parser&)> _on_keepalive_reponse;
|
||||
protected:
|
||||
// RTP端口,trackid idx 为数组下标 [AUTO-TRANSLATED:77c186bb]
|
||||
// RTP port, trackid idx is the array subscript
|
||||
|
||||
Loading…
Reference in New Issue
Block a user