mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-23 03:10:04 +08:00
修复hls播放器流量统计不准确的bug
This commit is contained in:
parent
1e1b3794da
commit
d26b751273
@ -48,8 +48,9 @@ HlsCookieData::~HlsCookieData() {
|
||||
<< ")断开,耗时(s):" << duration;
|
||||
|
||||
GET_CONFIG(uint32_t, iFlowThreshold, General::kFlowThreshold);
|
||||
if (_bytes > iFlowThreshold * 1024) {
|
||||
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _info, _bytes, duration, true, static_cast<SockInfo&>(*_sock_info));
|
||||
uint64_t bytes = _bytes.load();
|
||||
if (bytes > iFlowThreshold * 1024) {
|
||||
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _info, bytes, duration, true, static_cast<SockInfo&>(*_sock_info));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -103,10 +103,12 @@ public:
|
||||
HlsCookieData(const MediaInfo &info, const std::shared_ptr<SockInfo> &sock_info);
|
||||
~HlsCookieData();
|
||||
void addByteUsage(uint64_t bytes);
|
||||
|
||||
private:
|
||||
void addReaderCount();
|
||||
|
||||
private:
|
||||
uint64_t _bytes = 0;
|
||||
atomic<uint64_t> _bytes {0};
|
||||
MediaInfo _info;
|
||||
std::shared_ptr<bool> _added;
|
||||
weak_ptr<HlsMediaSource> _src;
|
||||
|
Loading…
Reference in New Issue
Block a user