summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm')
-rw-r--r--Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm b/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
index 98599e96b..29249aa78 100644
--- a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
+++ b/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
@@ -214,6 +214,7 @@ MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit(MediaPlayer* player)
, m_videoFrameHasDrawn(false)
, m_isAllowedToRender(false)
, m_privateBrowsing(false)
+ , m_maxTimeLoadedAtLastDidLoadingProgress(0)
#if DRAW_FRAME_RATE
, m_frameCountWhilePlaying(0)
, m_timeStartedPlaying(0)
@@ -945,12 +946,14 @@ float MediaPlayerPrivateQTKit::maxTimeLoaded() const
return wkQTMovieMaxTimeLoaded(m_qtMovie.get());
}
-unsigned MediaPlayerPrivateQTKit::bytesLoaded() const
+bool MediaPlayerPrivateQTKit::didLoadingProgress() const
{
- float dur = duration();
- if (!dur)
- return 0;
- return totalBytes() * maxTimeLoaded() / dur;
+ if (!duration() || !totalBytes())
+ return false;
+ float currentMaxTimeLoaded = maxTimeLoaded();
+ bool didLoadingProgress = currentMaxTimeLoaded != m_maxTimeLoadedAtLastDidLoadingProgress;
+ m_maxTimeLoadedAtLastDidLoadingProgress = currentMaxTimeLoaded;
+ return didLoadingProgress;
}
unsigned MediaPlayerPrivateQTKit::totalBytes() const