Title: [158734] trunk
- Revision
- 158734
- Author
- [email protected]
- Date
- 2013-11-06 01:32:26 -0800 (Wed, 06 Nov 2013)
Log Message
Source/WebCore: Seek for video doesn't work when playback rate is negative
https://bugs.webkit.org/show_bug.cgi?id=123791
In MediaPlayerPrivateGStreamer::seek negative playback rate was not taken to account.
Patch by Piotr Grad <[email protected]> on 2013-11-06
Reviewed by Philippe Normand.
Test: media/video-seek-with-negative-playback.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::seek):
LayoutTests: Test for seek not working properly with negative playback rate.
https://bugs.webkit.org/show_bug.cgi?id=123791
Seek method should work properly with negative playback rate.
Patch by Piotr Grad <[email protected]> on 2013-11-06
Reviewed by Philippe Normand.
* media/video-seek-with-negative-playback.html: Added.
* media/video-seek-with-negative-playback-expected.txt: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (158733 => 158734)
--- trunk/LayoutTests/ChangeLog 2013-11-06 08:19:38 UTC (rev 158733)
+++ trunk/LayoutTests/ChangeLog 2013-11-06 09:32:26 UTC (rev 158734)
@@ -1,3 +1,15 @@
+2013-11-06 Piotr Grad <[email protected]>
+
+ Test for seek not working properly with negative playback rate.
+ https://bugs.webkit.org/show_bug.cgi?id=123791
+
+ Seek method should work properly with negative playback rate.
+
+ Reviewed by Philippe Normand.
+
+ * media/video-seek-with-negative-playback.html: Added.
+ * media/video-seek-with-negative-playback-expected.txt: Added.
+
2013-11-06 Ryosuke Niwa <[email protected]>
Add a test for queries whose leftmost selector matches the root node
Added: trunk/LayoutTests/media/video-seek-with-negative-playback-expected.txt (0 => 158734)
--- trunk/LayoutTests/media/video-seek-with-negative-playback-expected.txt (rev 0)
+++ trunk/LayoutTests/media/video-seek-with-negative-playback-expected.txt 2013-11-06 09:32:26 UTC (rev 158734)
@@ -0,0 +1,7 @@
+EVENT(canplaythrough)
+EVENT(seeked)
+EVENT(timeupdate)
+EVENT(timeupdate)
+EXPECTED (video.currentTime < '3') OK
+END OF TEST
+
Added: trunk/LayoutTests/media/video-seek-with-negative-playback.html (0 => 158734)
--- trunk/LayoutTests/media/video-seek-with-negative-playback.html (rev 0)
+++ trunk/LayoutTests/media/video-seek-with-negative-playback.html 2013-11-06 09:32:26 UTC (rev 158734)
@@ -0,0 +1,32 @@
+<html>
+ <head>
+ <script src=""
+ <script src=""
+ <script>
+ var lastTime = -1;
+ function start() {
+ findMediaElement();
+ video.src = "" "content/test");
+ waitForEventOnce('canplaythrough',
+ function () {
+ video.playbackRate = -1;
+ video.currentTime = 3;
+ waitForEventOnce('seeked', function () {
+ waitForEvent('timeupdate', function () {
+ if (lastTime == -1) {
+ lastTime = video.currentTime;
+ return;
+ }
+ testExpected("video.currentTime", 3, "<");
+ endTest();
+ });
+ });
+ video.play();
+ });
+ }
+ </script>
+ </head>
+ <body _onload_="start()">
+ <video/>
+ </body>
+</html>
\ No newline at end of file
Modified: trunk/Source/WebCore/ChangeLog (158733 => 158734)
--- trunk/Source/WebCore/ChangeLog 2013-11-06 08:19:38 UTC (rev 158733)
+++ trunk/Source/WebCore/ChangeLog 2013-11-06 09:32:26 UTC (rev 158734)
@@ -1,3 +1,17 @@
+2013-11-06 Piotr Grad <[email protected]>
+
+ Seek for video doesn't work when playback rate is negative
+ https://bugs.webkit.org/show_bug.cgi?id=123791
+
+ In MediaPlayerPrivateGStreamer::seek negative playback rate was not taken to account.
+
+ Reviewed by Philippe Normand.
+
+ Test: media/video-seek-with-negative-playback.html
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::MediaPlayerPrivateGStreamer::seek):
+
2013-11-06 Andreas Kling <[email protected]>
Reinstate an annoying assertion that I accidentally commented out.
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (158733 => 158734)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2013-11-06 08:19:38 UTC (rev 158733)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2013-11-06 09:32:26 UTC (rev 158734)
@@ -613,9 +613,18 @@
loadingFailed(MediaPlayer::Empty);
}
} else {
+ gint64 startTime, endTime;
+ if (m_player->rate() > 0) {
+ startTime = clockTime;
+ endTime = GST_CLOCK_TIME_NONE;
+ } else {
+ startTime = 0;
+ endTime = clockTime;
+ }
+
// We can seek now.
if (!gst_element_seek(m_playBin.get(), m_player->rate(), GST_FORMAT_TIME, static_cast<GstSeekFlags>(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),
- GST_SEEK_TYPE_SET, clockTime, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) {
+ GST_SEEK_TYPE_SET, startTime, GST_SEEK_TYPE_SET, endTime)) {
LOG_MEDIA_MESSAGE("[Seek] seeking to %f failed", time);
return;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes