2010-04-30 Philippe Normand <pnormand@igalia.com>
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 May 2010 14:09:35 +0000 (14:09 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 May 2010 14:09:35 +0000 (14:09 +0000)
        Reviewed by Eric Seidel.

        [GStreamer] endless loop after playback ended
        https://bugs.webkit.org/show_bug.cgi?id=38384

        At playback end ensure duration() will return a valid duration if
        we managed to calculate it based on current position.

        Test: media/video-duration-known-after-eos.html

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::didEnd):

2010-04-30  Philippe Normand  <pnormand@igalia.com>

        Reviewed by Eric Seidel.

        [GStreamer] endless loop after playback ended
        https://bugs.webkit.org/show_bug.cgi?id=38384

        * media/video-duration-known-after-eos-expected.txt: Added.
        * media/video-duration-known-after-eos.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58671 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/media/video-duration-known-after-eos-expected.txt [new file with mode: 0644]
LayoutTests/media/video-duration-known-after-eos.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

index 3a9cb3b..b0ed137 100644 (file)
@@ -1,3 +1,13 @@
+2010-04-30  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Eric Seidel.
+
+        [GStreamer] endless loop after playback ended
+        https://bugs.webkit.org/show_bug.cgi?id=38384
+
+        * media/video-duration-known-after-eos-expected.txt: Added.
+        * media/video-duration-known-after-eos.html: Added.
+
 2010-05-02  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/LayoutTests/media/video-duration-known-after-eos-expected.txt b/LayoutTests/media/video-duration-known-after-eos-expected.txt
new file mode 100644 (file)
index 0000000..e067c52
--- /dev/null
@@ -0,0 +1,7 @@
+Tests that duration is known after playback ended.
+
+
+RUN(video.play())
+EXPECTED (video.duration > '0') OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-duration-known-after-eos.html b/LayoutTests/media/video-duration-known-after-eos.html
new file mode 100644 (file)
index 0000000..f706027
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+
+<html>
+    <head>
+        <title>local video</title>
+
+        <script src=media-file.js></script>
+        <script src=video-test.js></script>
+
+        <script>
+            function ended()
+            {
+                testExpected("video.duration", 0, '>');
+                endTest();
+            }
+
+            function start()
+            {
+                findMediaElement();
+
+                video.addEventListener("ended", ended);
+
+                video.src = findMediaFile("video", "content/test");
+                consoleWrite("");
+                run("video.play()");
+            }
+
+        </script>
+    </head>
+    <body>
+        <video controls autobuffer></video>
+        <p>Tests that duration is known after playback ended.</p>
+        <script>start()</script>
+    </body>
+</html>
+
+
index d3f0f60..a431589 100644 (file)
@@ -1,3 +1,18 @@
+2010-04-30  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Eric Seidel.
+
+        [GStreamer] endless loop after playback ended
+        https://bugs.webkit.org/show_bug.cgi?id=38384
+
+        At playback end ensure duration() will return a valid duration if
+        we managed to calculate it based on current position.
+
+        Test: media/video-duration-known-after-eos.html
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::didEnd):
+
 2010-05-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
 
         [Qt] Fix build break on Mac OS X
index 0afb971..8f6c9e0 100644 (file)
@@ -1111,6 +1111,7 @@ void MediaPlayerPrivateGStreamer::didEnd()
     float now = currentTime();
     if (now > 0) {
         m_mediaDuration = now;
+        m_mediaDurationKnown = true;
         m_player->durationChanged();
     }