Title: [150929] trunk
Revision
150929
Author
jer.no...@apple.com
Date
2013-05-29 14:20:47 -0700 (Wed, 29 May 2013)

Log Message

[Mac] Scrubbing long movie files results in timeline snapping back to 0 during scrub.
https://bugs.webkit.org/show_bug.cgi?id=116986

Reviewed by Eric Carlson.

Source/WebCore:

Keep a count of the number of in-flight seek requests, and only issue a timeupdate
(which triggers a "seeked" event) when the final seek completes.

Test: media/video-seek-multiple.html

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::seek):
(WebCore::MediaPlayerPrivateAVFoundation::seekCompleted):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(MediaPlayerPrivateAVFoundation):

LayoutTests:

* media/video-seek-multiple-expected.txt: Added.
* media/video-seek-multiple.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (150928 => 150929)


--- trunk/LayoutTests/ChangeLog	2013-05-29 20:55:33 UTC (rev 150928)
+++ trunk/LayoutTests/ChangeLog	2013-05-29 21:20:47 UTC (rev 150929)
@@ -1,5 +1,15 @@
 2013-05-29  Jer Noble  <jer.no...@apple.com>
 
+        [Mac] Scrubbing long movie files results in timeline snapping back to 0 during scrub.
+        https://bugs.webkit.org/show_bug.cgi?id=116986
+
+        Reviewed by Eric Carlson.
+
+        * media/video-seek-multiple-expected.txt: Added.
+        * media/video-seek-multiple.html: Added.
+
+2013-05-29  Jer Noble  <jer.no...@apple.com>
+
         media/video-pause-immediately.html test failing on some platforms.
         https://bugs.webkit.org/show_bug.cgi?id=116985
 

Added: trunk/LayoutTests/media/video-seek-multiple-expected.txt (0 => 150929)


--- trunk/LayoutTests/media/video-seek-multiple-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/media/video-seek-multiple-expected.txt	2013-05-29 21:20:47 UTC (rev 150929)
@@ -0,0 +1,14 @@
+Test that multiple seeks issued at the same time will result in only a single 'seeked' event.
+
+EVENT(canplaythrough)
+RUN(video.currentTime = 0.5)
+RUN(video.currentTime = 1.5)
+RUN(video.currentTime = 2.0)
+EXPECTED (video.seeking == 'true') OK
+
+EVENT(seeked)
+
+EXPECTED (video.seeking == 'false') OK
+EXPECTED (video.currentTime == '2') OK
+END OF TEST
+

Added: trunk/LayoutTests/media/video-seek-multiple.html (0 => 150929)


--- trunk/LayoutTests/media/video-seek-multiple.html	                        (rev 0)
+++ trunk/LayoutTests/media/video-seek-multiple.html	2013-05-29 21:20:47 UTC (rev 150929)
@@ -0,0 +1,33 @@
+<video controls></video>
+<p>Test that multiple seeks issued at the same time will result in only a single 'seeked' event.
+ </p>
+<script src=""
+<script src=""
+<script>
+
+    function seeked()
+    { 
+        consoleWrite("");
+
+        testExpected("video.seeking", false);
+        testExpected("video.currentTime", 2);
+
+        waitForEventAndFail('seeked');
+        setTimeout(endTest, 0.1);
+     }
+
+    function canplaythrough() 
+    {
+        run("video.currentTime = 0.5");
+        run("video.currentTime = 1.5");
+        run("video.currentTime = 2.0");
+        testExpected("video.seeking", true);
+        consoleWrite("");
+    }
+    
+    waitForEvent('waiting' );
+    waitForEventOnce('seeked', seeked );
+    waitForEvent('canplaythrough', canplaythrough);
+
+    video.src = "" "content/test");
+</script>

Modified: trunk/Source/WebCore/ChangeLog (150928 => 150929)


--- trunk/Source/WebCore/ChangeLog	2013-05-29 20:55:33 UTC (rev 150928)
+++ trunk/Source/WebCore/ChangeLog	2013-05-29 21:20:47 UTC (rev 150929)
@@ -1,3 +1,21 @@
+2013-05-29  Jer Noble  <jer.no...@apple.com>
+
+        [Mac] Scrubbing long movie files results in timeline snapping back to 0 during scrub.
+        https://bugs.webkit.org/show_bug.cgi?id=116986
+
+        Reviewed by Eric Carlson.
+
+        Keep a count of the number of in-flight seek requests, and only issue a timeupdate
+        (which triggers a "seeked" event) when the final seek completes.
+
+        Test: media/video-seek-multiple.html
+
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::seek):
+        (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted):
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+        (MediaPlayerPrivateAVFoundation):
+
 2013-05-29  Anders Carlsson  <ander...@apple.com>
 
         Remove unused code from PODArena

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (150928 => 150929)


--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2013-05-29 20:55:33 UTC (rev 150928)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2013-05-29 21:20:47 UTC (rev 150929)
@@ -77,6 +77,7 @@
 #if !PLATFORM(WIN)
     , m_inbandTrackConfigurationPending(false)
 #endif
+    , m_seekCount(0)
 {
     LOG(Media, "MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation(%p)", this);
 }
@@ -274,6 +275,7 @@
     LOG(Media, "MediaPlayerPrivateAVFoundation::seek(%p) - seeking to %f", this, time);
     m_seekTo = time;
 
+    ++m_seekCount;
     seekToTime(time);
 }
 
@@ -593,6 +595,10 @@
     LOG(Media, "MediaPlayerPrivateAVFoundation::seekCompleted(%p) - finished = %d", this, finished);
     UNUSED_PARAM(finished);
 
+    ASSERT(m_seekCount);
+    if (--m_seekCount)
+        return;
+
 #if !PLATFORM(WIN)
     if (currentTrack())
         currentTrack()->endSeeking();

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (150928 => 150929)


--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2013-05-29 20:55:33 UTC (rev 150928)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2013-05-29 21:20:47 UTC (rev 150929)
@@ -309,6 +309,7 @@
 #if !PLATFORM(WIN)
     bool m_inbandTrackConfigurationPending;
 #endif
+    size_t m_seekCount;
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to