diff --git a/conf/config.ini b/conf/config.ini index b0b12477..95d3fa37 100644 --- a/conf/config.ini +++ b/conf/config.ini @@ -127,7 +127,7 @@ wait_add_track_ms=3000 #如果track未就绪,我们先缓存帧数据,但是有最大个数限制,防止内存溢出 unready_frame_cache=100 #是否启用观看人数变化事件广播,置1则启用,置0则关闭 -enablePlayerCountChangeEvent=0 +broadcast_player_count_changed=0 [hls] #hls写文件的buf大小,调整参数可以提高文件io性能 diff --git a/src/Common/MediaSource.cpp b/src/Common/MediaSource.cpp index 5352c8ae..039b156a 100644 --- a/src/Common/MediaSource.cpp +++ b/src/Common/MediaSource.cpp @@ -652,7 +652,7 @@ MediaSource::Ptr MediaSource::createFromMP4(const string &schema, const string & /////////////////////////////////////MediaSourceEvent////////////////////////////////////// void MediaSourceEvent::onReaderChanged(MediaSource &sender, int size){ - GET_CONFIG(int, enable, General::kEnablePlayerCountChangeEvent); + GET_CONFIG(bool, enable, General::kBroadcastPlayerCountChanged); if (enable) { NOTICE_EMIT(BroadcastPlayerCountChangedArgs, Broadcast::kBroadcastPlayerCountChanged, sender.getMediaTuple(), sender.totalReaderCount()); } diff --git a/src/Common/config.cpp b/src/Common/config.cpp index 0ace2dad..f2ec0354 100644 --- a/src/Common/config.cpp +++ b/src/Common/config.cpp @@ -83,7 +83,7 @@ const string kEnableFFmpegLog = GENERAL_FIELD "enable_ffmpeg_log"; const string kWaitTrackReadyMS = GENERAL_FIELD "wait_track_ready_ms"; const string kWaitAddTrackMS = GENERAL_FIELD "wait_add_track_ms"; const string kUnreadyFrameCache = GENERAL_FIELD "unready_frame_cache"; -const string kEnablePlayerCountChangeEvent = GENERAL_FIELD "enablePlayerCountChangeEvent"; +const string kBroadcastPlayerCountChanged = GENERAL_FIELD "broadcast_player_count_changed"; static onceToken token([]() { mINI::Instance()[kFlowThreshold] = 1024; @@ -98,7 +98,7 @@ static onceToken token([]() { mINI::Instance()[kWaitTrackReadyMS] = 10000; mINI::Instance()[kWaitAddTrackMS] = 3000; mINI::Instance()[kUnreadyFrameCache] = 100; - mINI::Instance()[kEnablePlayerCountChangeEvent] = 0; + mINI::Instance()[kBroadcastPlayerCountChanged] = 0; }); } // namespace General diff --git a/src/Common/config.h b/src/Common/config.h index 45788ae6..4b6423a5 100644 --- a/src/Common/config.h +++ b/src/Common/config.h @@ -201,7 +201,7 @@ extern const std::string kWaitAddTrackMS; // 如果track未就绪,我们先缓存帧数据,但是有最大个数限制(100帧时大约4秒),防止内存溢出 extern const std::string kUnreadyFrameCache; // 是否启用观看人数变化事件广播,置1则启用,置0则关闭 -extern const std::string kEnablePlayerCountChangeEvent; +extern const std::string kBroadcastPlayerCountChanged; } // namespace General namespace Protocol {