mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 08:13:35 +00:00
Bug 1286444 - Fix types when using VideoPlaybackQuality values - r=kinetik
These numbers are only used to calculate a percentage, so they don't really need to be 64-bit long. MozReview-Commit-ID: FfdyStjGITL --HG-- extra : rebase_source : 704d7664a3462f68f2c495e3b5d66f71180d290b
This commit is contained in:
parent
46e43139df
commit
ddbe07d2c6
@ -3077,9 +3077,12 @@ HTMLMediaElement::ReportTelemetry()
|
||||
|
||||
if (HTMLVideoElement* vid = HTMLVideoElement::FromContentOrNull(this)) {
|
||||
RefPtr<VideoPlaybackQuality> quality = vid->GetVideoPlaybackQuality();
|
||||
uint64_t totalFrames = quality->TotalVideoFrames();
|
||||
uint64_t droppedFrames = quality->DroppedVideoFrames();
|
||||
uint32_t totalFrames = quality->TotalVideoFrames();
|
||||
if (totalFrames) {
|
||||
uint32_t droppedFrames = quality->DroppedVideoFrames();
|
||||
MOZ_ASSERT(droppedFrames <= totalFrames);
|
||||
// Dropped frames <= total frames, so 'percentage' cannot be higher than
|
||||
// 100 and therefore can fit in a uint32_t (that Telemetry takes).
|
||||
uint32_t percentage = 100 * droppedFrames / totalFrames;
|
||||
LOG(LogLevel::Debug,
|
||||
("Reporting telemetry DROPPED_FRAMES_IN_VIDEO_PLAYBACK"));
|
||||
|
Loading…
Reference in New Issue
Block a user