From d21bdc35c9e0603f506d94b966d9e24c4ed5d1e0 Mon Sep 17 00:00:00 2001 From: Dw9 Date: Thu, 7 Dec 2023 22:05:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Daddstreamproxy=E6=8B=89?= =?UTF-8?q?=E6=B5=81=E7=9E=AC=E9=97=B4=E8=B6=85=E6=97=B6=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#3093)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/WebApi.cpp | 4 +++- src/Player/MediaPlayer.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 59f44f66..decef1ce 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -555,6 +555,9 @@ void addStreamProxy(const string &vhost, const string &app, const string &stream auto player = std::make_shared(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 lck(s_proxyMapMtx); s_proxyMap.erase(key); }); - player->mINI::operator=(args); player->play(url); }; diff --git a/src/Player/MediaPlayer.cpp b/src/Player/MediaPlayer.cpp index 1eb5f449..7dfa82b5 100644 --- a/src/Player/MediaPlayer.cpp +++ b/src/Player/MediaPlayer.cpp @@ -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); }