[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

philn at webkit.org philn at webkit.org
Wed Dec 22 13:11:26 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit ffe754d0b688f9582884ba2e6641cafefb57c57a
Author: philn at webkit.org <philn at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 8 15:55:44 2010 +0000

    2010-09-08  Philippe Normand  <pnormand at igalia.com>
    
            Reviewed by Eric Carlson.
    
            [GStreamer] cache media duration in READY instead of PLAYING
            https://bugs.webkit.org/show_bug.cgi?id=39053
    
            New cacheDuration private method used to in updateStates() and
            durationChanged().
    
            * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
            (WebCore::MediaPlayerPrivateGStreamer::updateStates):
            (WebCore::MediaPlayerPrivateGStreamer::cacheDuration):
            (WebCore::MediaPlayerPrivateGStreamer::durationChanged):
            * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66987 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2661247..3d00a35 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-08  Philippe Normand  <pnormand at igalia.com>
+
+        Reviewed by Eric Carlson.
+
+        [GStreamer] cache media duration in READY instead of PLAYING
+        https://bugs.webkit.org/show_bug.cgi?id=39053
+
+        New cacheDuration private method used to in updateStates() and
+        durationChanged().
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::updateStates):
+        (WebCore::MediaPlayerPrivateGStreamer::cacheDuration):
+        (WebCore::MediaPlayerPrivateGStreamer::durationChanged):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
 2010-09-08  Martin Robinson  <mrobinson at igalia.com>
 
         Reviewed by Xan Lopez.
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index c9f63f5..513f3c2 100644
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -839,8 +839,12 @@ void MediaPlayerPrivateGStreamer::updateStates()
 
         // Try to figure out ready and network states.
         if (state == GST_STATE_READY) {
-            m_readyState = MediaPlayer::HaveNothing;
+            m_readyState = MediaPlayer::HaveMetadata;
             m_networkState = MediaPlayer::Empty;
+            // Cache the duration without emiting the durationchange
+            // event because it's taken care of by the media element
+            // in this precise case.
+            cacheDuration();
         } else if (maxTimeLoaded() == duration()) {
             m_networkState = MediaPlayer::Loaded;
             m_readyState = MediaPlayer::HaveEnoughData;
@@ -876,13 +880,6 @@ void MediaPlayerPrivateGStreamer::updateStates()
             m_readyState = MediaPlayer::HaveEnoughData;
             m_paused = false;
 
-            if (!m_mediaDuration) {
-                float newDuration = duration();
-                m_mediaDurationKnown = !isinf(newDuration);
-                if (m_mediaDurationKnown)
-                    m_mediaDuration = newDuration;
-            }
-
             if (m_buffering) {
                 m_readyState = MediaPlayer::HaveCurrentData;
                 m_networkState = MediaPlayer::Loading;
@@ -1115,7 +1112,7 @@ void MediaPlayerPrivateGStreamer::didEnd()
     timeChanged();
 }
 
-void MediaPlayerPrivateGStreamer::durationChanged()
+void MediaPlayerPrivateGStreamer::cacheDuration()
 {
     // Reset cached media duration
     m_mediaDuration = 0;
@@ -1139,8 +1136,16 @@ void MediaPlayerPrivateGStreamer::durationChanged()
 
     if (!isinf(newDuration))
         m_mediaDuration = newDuration;
+}
 
-    m_player->durationChanged();
+void MediaPlayerPrivateGStreamer::durationChanged()
+{
+    float previousDuration = m_mediaDuration;
+
+    cacheDuration();
+
+    if (m_mediaDuration != previousDuration)
+        m_player->durationChanged();
 }
 
 bool MediaPlayerPrivateGStreamer::supportsMuting() const
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
index cc1a731..6d1392d 100644
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
@@ -131,6 +131,7 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface {
             static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
             static bool isAvailable();
 
+            void cacheDuration();
             void updateStates();
             void cancelSeek();
             void endPointTimerFired(Timer<MediaPlayerPrivateGStreamer>*);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list