mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 22:55:52 +08:00
优化拉流代理成功率
This commit is contained in:
parent
0efe7a26b5
commit
e0920536cc
@ -99,7 +99,7 @@ void PlayerProxy::play(const char* strUrl) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(strongSelf->_mediaMuxer) {
|
if(strongSelf->_mediaMuxer) {
|
||||||
auto tracks = strongSelf->getTracks();
|
auto tracks = strongSelf->getTracks(false);
|
||||||
for (auto & track : tracks){
|
for (auto & track : tracks){
|
||||||
track->delDelegate(strongSelf->_mediaMuxer.get());
|
track->delDelegate(strongSelf->_mediaMuxer.get());
|
||||||
}
|
}
|
||||||
@ -176,7 +176,7 @@ void PlayerProxy::onPlaySuccess() {
|
|||||||
_mediaMuxer.reset(new MultiMediaSourceMuxer(_strVhost.data(),_strApp.data(),_strSrc.data(),getDuration(),_bEnableHls,_bEnableMp4));
|
_mediaMuxer.reset(new MultiMediaSourceMuxer(_strVhost.data(),_strApp.data(),_strSrc.data(),getDuration(),_bEnableHls,_bEnableMp4));
|
||||||
_mediaMuxer->setListener(shared_from_this());
|
_mediaMuxer->setListener(shared_from_this());
|
||||||
|
|
||||||
auto videoTrack = getTrack(TrackVideo);
|
auto videoTrack = getTrack(TrackVideo,false);
|
||||||
if(videoTrack){
|
if(videoTrack){
|
||||||
//添加视频
|
//添加视频
|
||||||
_mediaMuxer->addTrack(videoTrack);
|
_mediaMuxer->addTrack(videoTrack);
|
||||||
@ -184,7 +184,7 @@ void PlayerProxy::onPlaySuccess() {
|
|||||||
videoTrack->addDelegate(_mediaMuxer);
|
videoTrack->addDelegate(_mediaMuxer);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto audioTrack = getTrack(TrackAudio);
|
auto audioTrack = getTrack(TrackAudio, false);
|
||||||
if(audioTrack){
|
if(audioTrack){
|
||||||
//添加音频
|
//添加音频
|
||||||
_mediaMuxer->addTrack(audioTrack);
|
_mediaMuxer->addTrack(audioTrack);
|
||||||
|
Loading…
Reference in New Issue
Block a user