RESOLVED FIXED 90734
[GStreamer] usec rounding is wrong during accurate seeking
https://bugs.webkit.org/show_bug.cgi?id=90734
Summary [GStreamer] usec rounding is wrong during accurate seeking
Philippe Normand
Reported 2012-07-07 20:04:49 PDT
The current approach is dummy :( We should switch to a floor()-based rounding solution.
Attachments
Patch (1.96 KB, patch)
2012-07-07 20:39 PDT, Philippe Normand
no flags
Patch (5.20 KB, patch)
2012-07-18 07:21 PDT, Philippe Normand
webkit.review.bot: commit-queue-
Archive of layout-test-results from gce-cr-linux-06 (554.22 KB, application/zip)
2012-07-18 08:00 PDT, WebKit Review Bot
no flags
Patch (681.33 KB, patch)
2012-07-18 08:32 PDT, Philippe Normand
no flags
Archive of layout-test-results from gce-cr-linux-05 (355.22 KB, application/zip)
2012-07-18 09:08 PDT, WebKit Review Bot
no flags
Patch (111.32 KB, patch)
2013-04-14 10:45 PDT, Philippe Normand
buildbot: commit-queue-
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion (709.89 KB, application/zip)
2013-04-15 00:56 PDT, Build Bot
no flags
Archive of layout-test-results from webkit-ews-03 for mac-mountainlion (714.63 KB, application/zip)
2013-04-15 01:59 PDT, Build Bot
no flags
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2 (838.54 KB, application/zip)
2013-04-15 02:24 PDT, Build Bot
no flags
Patch (189.99 KB, patch)
2013-05-01 15:18 PDT, Philippe Normand
no flags
Patch (220.56 KB, patch)
2014-09-19 00:47 PDT, Philippe Normand
no flags
Patch (167.30 KB, patch)
2014-09-19 00:50 PDT, Philippe Normand
mcatanzaro: review-
patch (138.86 KB, patch)
2016-06-28 04:13 PDT, Philippe Normand
cgarcia: review+
Philippe Normand
Comment 1 2012-07-07 20:09:05 PDT
With the current implementation 6.027200 seconds rounds to 6.030000. Kind of far fetched rounding.
Philippe Normand
Comment 2 2012-07-07 20:39:36 PDT
Martin Robinson
Comment 3 2012-07-09 08:00:20 PDT
Can you give an example of how this affects rounding? Before, 6.0272 was rounded to 6.03. What is it rounded to now? Does this affect tests at all?
Philippe Normand
Comment 4 2012-07-18 07:06:19 PDT
(In reply to comment #3) > Can you give an example of how this affects rounding? Before, 6.0272 was rounded to 6.03. Yes. Example when running media/video-seek-past-end-playing.html Seek to 6.027200: 6.000000 secs 30000 usecs Seek: 0:00:06.030000000 > What is it rounded to now? Now, same test with the patch: Seek to 6.027200: 6.000000 secs 27200 usecs Seek: 0:00:06.027200000 > Does this affect tests at all? Yes, well with the patch media/video-frame-accurate-seek.html still passes. The issue with the previous rounding "strategy" is that some values were correctly rounded and some not, as you can see above. Maybe I can update the layout test!
Philippe Normand
Comment 5 2012-07-18 07:21:55 PDT
WebKit Review Bot
Comment 6 2012-07-18 08:00:48 PDT
Comment on attachment 153007 [details] Patch Attachment 153007 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13273552 New failing tests: media/video-frame-accurate-seek.html
WebKit Review Bot
Comment 7 2012-07-18 08:00:52 PDT
Created attachment 153014 [details] Archive of layout-test-results from gce-cr-linux-06 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: gce-cr-linux-06 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Philippe Normand
Comment 8 2012-07-18 08:32:54 PDT
WebKit Review Bot
Comment 9 2012-07-18 09:08:05 PDT
Comment on attachment 153019 [details] Patch Attachment 153019 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13282548 New failing tests: media/video-frame-accurate-seek.html
WebKit Review Bot
Comment 10 2012-07-18 09:08:13 PDT
Created attachment 153023 [details] Archive of layout-test-results from gce-cr-linux-05 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: gce-cr-linux-05 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Philippe Normand
Comment 11 2013-04-12 13:09:38 PDT
Comment on attachment 153019 [details] Patch I need to rework/rebase this patch
Philippe Normand
Comment 12 2013-04-14 10:12:41 PDT
I think there might be some small bugs in the GStreamer decoders, making sure currentTime() is as accurate as the seek method I can still see the frame displayed is either the one preceding or following the one requested. The video-frame-accurate-seek test actually shows the issue too, 3rd video should show frame #14 but shows frame #15 instead.
Philippe Normand
Comment 13 2013-04-14 10:45:28 PDT
Build Bot
Comment 14 2013-04-15 00:56:19 PDT
Comment on attachment 198003 [details] Patch Attachment 198003 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/47297 New failing tests: http/tests/ssl/ping-with-unsafe-redirect.html media/video-frame-accurate-seek.html
Build Bot
Comment 15 2013-04-15 00:56:22 PDT
Created attachment 198030 [details] Archive of layout-test-results from webkit-ews-02 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-02 Port: mac-mountainlion Platform: Mac OS X 10.8.2
Build Bot
Comment 16 2013-04-15 01:59:12 PDT
Comment on attachment 198003 [details] Patch Attachment 198003 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/139189 New failing tests: http/tests/ssl/ping-with-unsafe-redirect.html media/video-frame-accurate-seek.html
Build Bot
Comment 17 2013-04-15 01:59:17 PDT
Created attachment 198037 [details] Archive of layout-test-results from webkit-ews-03 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-03 Port: mac-mountainlion Platform: Mac OS X 10.8.2
Build Bot
Comment 18 2013-04-15 02:24:41 PDT
Comment on attachment 198003 [details] Patch Attachment 198003 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/30262 New failing tests: media/video-frame-accurate-seek.html
Build Bot
Comment 19 2013-04-15 02:24:46 PDT
Created attachment 198040 [details] Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-12 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.2
Philippe Normand
Comment 20 2013-05-01 15:18:39 PDT
Philippe Normand
Comment 21 2014-09-19 00:47:11 PDT
Created attachment 238351 [details] Patch Rebased.
Philippe Normand
Comment 22 2014-09-19 00:49:14 PDT
Comment on attachment 238351 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=238351&action=review > Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp:158 > + timeValue.tv_usec = static_cast<glong>(floor(microSeconds = 0.5)); oops.
Philippe Normand
Comment 23 2014-09-19 00:50:17 PDT
Michael Catanzaro
Comment 24 2016-01-02 10:03:18 PST
Comment on attachment 238352 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=238352&action=review The code changes in this patch look fine, but I don't understand the test. > LayoutTests/media/video-frame-accurate-seek.html:8 > + <p>Test that setting currentTime is frame-accurate. Four videos below should be showing up, The first three at frames 12, 13, and 14. The last video should display at 6.0272 seconds.</p> The -> the > LayoutTests/platform/gtk/media/video-frame-accurate-seek-expected.txt:9 > + text run at (0,17) width 356: "and 14. The last video should display at 6.0272 seconds." It seems like something is wrong with this test. The expected result for the first three videos shows 12, 13, and 15, but the test says it's expected to show 12, 13, and 14. The last video displays 6.01 seconds, not 6.0272 or 6.03. > LayoutTests/platform/mac/TestExpectations:1392 > +webkit.org/b/90734 media/video-frame-accurate-seek.html [ Failure ] I think you should file new bugs for the EFL and Mac rebaselines, else they probably won't happen if you add an expectation to hide the failures.
Philippe Normand
Comment 25 2016-01-04 00:33:00 PST
(In reply to comment #24) > Comment on attachment 238352 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=238352&action=review > > The code changes in this patch look fine, but I don't understand the test. > > > LayoutTests/media/video-frame-accurate-seek.html:8 > > + <p>Test that setting currentTime is frame-accurate. Four videos below should be showing up, The first three at frames 12, 13, and 14. The last video should display at 6.0272 seconds.</p> > > The -> the > > > LayoutTests/platform/gtk/media/video-frame-accurate-seek-expected.txt:9 > > + text run at (0,17) width 356: "and 14. The last video should display at 6.0272 seconds." > > It seems like something is wrong with this test. The expected result for the > first three videos shows 12, 13, and 15, but the test says it's expected to > show 12, 13, and 14. The last video displays 6.01 seconds, not 6.0272 or > 6.03. > See comment 12.
Philippe Normand
Comment 26 2016-06-21 04:44:14 PDT
(In reply to comment #24) > Comment on attachment 238352 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=238352&action=review > > The code changes in this patch look fine, but I don't understand the test. > > > LayoutTests/media/video-frame-accurate-seek.html:8 > > + <p>Test that setting currentTime is frame-accurate. Four videos below should be showing up, The first three at frames 12, 13, and 14. The last video should display at 6.0272 seconds.</p> > > The -> the > > > LayoutTests/platform/gtk/media/video-frame-accurate-seek-expected.txt:9 > > + text run at (0,17) width 356: "and 14. The last video should display at 6.0272 seconds." > > It seems like something is wrong with this test. The expected result for the > first three videos shows 12, 13, and 15, but the test says it's expected to > show 12, 13, and 14. This now works as expected \o/ > The last video displays 6.01 seconds, not 6.0272 or > 6.03. > That's because 6.01 means (6 * 25) + 1 frames = 151. And not 0.01 seconds. So we do a seek to 6.0272 seconds which means 6 seconds and one half-frame (0.02 = 1/50) but the video is at 25fps so the demuxer choses instead to jump to the next full frame, if I understand correctly.
Philippe Normand
Comment 27 2016-06-28 04:13:11 PDT
Philippe Normand
Comment 28 2016-06-28 04:26:42 PDT
Note You need to log in before you can comment on or make changes to this bug.