修改Rtmp播放结果回调事件触发机制,防止秒开失败以及获取Track失败

This commit is contained in:
xiongziliang
2019-08-01 13:12:24 +08:00
parent fcdcf12af9
commit 2e95c3b2fa
6 changed files with 29 additions and 63 deletions

View File

@@ -245,14 +245,9 @@ protected:
_playResultCB = nullptr;
return;
}
//播放成功我们还必须等待各个Track初始化完毕才能回调告知已经初始化完毕
if(isInited(0xFFFF)){
//初始化完毕则立即回调
_playResultCB(ex);
_playResultCB = nullptr;
return;
}
//播放成功却未初始化完毕,这个时候不回调汇报播放成功
//播放成功
_playResultCB(ex);
_playResultCB = nullptr;
}
void onResume() override{
@@ -260,16 +255,6 @@ protected:
_resumeCB();
}
}
void checkInited(int analysisMs){
if(!_playResultCB){
return;
}
if(isInited(analysisMs)){
_playResultCB(SockException(Err_success,"play success"));
_playResultCB = nullptr;
}
}
protected:
function<void(const SockException &ex)> _shutdownCB;
function<void(const SockException &ex)> _playResultCB;