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