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); }