修复addstreamproxy拉流瞬间超时的问题 (#3093)

This commit is contained in:
Dw9 2023-12-07 22:05:20 +08:00 committed by GitHub
parent 8682a655d7
commit d21bdc35c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -555,6 +555,9 @@ void addStreamProxy(const string &vhost, const string &app, const string &stream
auto player = std::make_shared<PlayerProxy>(vhost, app, stream, option, retry_count);
s_proxyMap[key] = player;
// 先透传参数
player->mINI::operator=(args);
//指定RTP over TCP(播放rtsp时有效)
(*player)[Client::kRtpType] = rtp_type;
@ -577,7 +580,6 @@ void addStreamProxy(const string &vhost, const string &app, const string &stream
lock_guard<recursive_mutex> lck(s_proxyMapMtx);
s_proxyMap.erase(key);
});
player->mINI::operator=(args);
player->play(url);
};

View File

@ -42,7 +42,9 @@ void MediaPlayer::play(const string &url) {
_delegate->setOnPlayResult(_on_play_result);
_delegate->setOnResume(_on_resume);
_delegate->setMediaSource(_media_src);
_delegate->mINI::operator=(*this);
for (auto &pr : *this) {
(*_delegate)[pr.first] = pr.second;
}
_delegate->play(url);
}