Fix addStreamProxy retry bug (#3830 #3810 #3837)

Fix addStreamProxy retry bug( protocol option overwrite once play
success ), result in some media source not register; it's found by the
issue #3830 #3810
This commit is contained in:
xiongguangjie 2024-08-22 11:11:04 +08:00 committed by GitHub
parent 6889afbc76
commit cb1821cf88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -288,14 +288,18 @@ void PlayerProxy::onPlaySuccess() {
if (dynamic_pointer_cast<RtspMediaSource>(_media_src)) {
// rtsp拉流代理
if (reset_when_replay || !_muxer) {
auto old = _option.enable_rtsp;
_option.enable_rtsp = false;
_muxer = std::make_shared<MultiMediaSourceMuxer>(_tuple, getDuration(), _option);
_option.enable_rtsp = old;
}
} else if (dynamic_pointer_cast<RtmpMediaSource>(_media_src)) {
// rtmp拉流代理
if (reset_when_replay || !_muxer) {
auto old = _option.enable_rtmp;
_option.enable_rtmp = false;
_muxer = std::make_shared<MultiMediaSourceMuxer>(_tuple, getDuration(), _option);
_option.enable_rtmp = old;
}
} else {
// 其他拉流代理