mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-14 03:55:58 +08:00
播放器支持超时时间的配置项
优化函数命名
This commit is contained in:
@@ -39,8 +39,13 @@ const char PlayerBase::kRtspUser[] = "rtsp_user" ;
|
||||
const char PlayerBase::kRtspPwd[] = "rtsp_pwd";
|
||||
const char PlayerBase::kRtspPwdIsMD5[] = "rtsp_pwd_md5";
|
||||
|
||||
const char PlayerBase::kPlayTimeoutMS[] = "play_timeout_ms";
|
||||
const char PlayerBase::kMediaTimeoutMS[] = "media_timeout_ms";
|
||||
const char PlayerBase::kBeatIntervalMS[] = "beat_interval_ms";
|
||||
const char PlayerBase::kMaxAnalysisMS[] = "max_analysis_ms";
|
||||
|
||||
PlayerBase::Ptr PlayerBase::createPlayer(const char* strUrl) {
|
||||
|
||||
PlayerBase::Ptr PlayerBase::createPlayer(const char* strUrl) {
|
||||
static auto releasePlayer = [](PlayerBase *ptr){
|
||||
onceToken token(nullptr,[&](){
|
||||
delete ptr;
|
||||
@@ -57,6 +62,13 @@ PlayerBase::Ptr PlayerBase::createPlayer(const char* strUrl) {
|
||||
return PlayerBase::Ptr(new RtspPlayerImp(),releasePlayer);
|
||||
}
|
||||
|
||||
PlayerBase::PlayerBase() {
|
||||
this->mINI::operator[](kPlayTimeoutMS) = 10000;
|
||||
this->mINI::operator[](kMediaTimeoutMS) = 5000;
|
||||
this->mINI::operator[](kBeatIntervalMS) = 5000;
|
||||
this->mINI::operator[](kMaxAnalysisMS) = 2000;
|
||||
}
|
||||
|
||||
///////////////////////////Demuxer//////////////////////////////
|
||||
bool Demuxer::isInited(int analysisMs) {
|
||||
if(_ticker.createdTime() < analysisMs){
|
||||
|
||||
Reference in New Issue
Block a user