mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-14 03:55:58 +08:00
修改Rtmp播放结果回调事件触发机制,防止秒开失败以及获取Track失败
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user