[MSE][GStreamer] Don't construct segments on PlaybackPipeline::flush
authoraboya@igalia.com <aboya@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Mar 2019 12:22:23 +0000 (12:22 +0000)
committeraboya@igalia.com <aboya@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Mar 2019 12:22:23 +0000 (12:22 +0000)
commit8ac5490b67d2936012150b17423ad1792c3c46d7
tree0cfeaadec1a5e899b8c9a902528f942568ba3baf
parent9be3d58c93c5b2c862c927e59b48bdfa4e543ad0
[MSE][GStreamer] Don't construct segments on PlaybackPipeline::flush
https://bugs.webkit.org/show_bug.cgi?id=195867

Reviewed by Xabier Rodriguez-Calvar.

LayoutTests/imported/w3c:

These tests check that video and audio are roughly in sync with each
other and with the reported player position during MSE playback.

* web-platform-tests/media-source/mediasource-correct-frames-after-reappend-expected.txt: Added.
* web-platform-tests/media-source/mediasource-correct-frames-after-reappend.html: Added.
* web-platform-tests/media-source/mediasource-correct-frames-expected.txt: Added.
* web-platform-tests/media-source/mediasource-correct-frames.html: Added.
* web-platform-tests/media-source/mp4/test-boxes-audio.mp4: Added.
* web-platform-tests/media-source/mp4/test-boxes-video.mp4: Added.

Source/WebCore:

The previous approach did not really work for flushes on only one
branch, as setting reset-time in FLUSH_STOP affects the running time
of the entire pipeline, causing timing issues in the other branch.

Since it's preferable not to interfere with the other branch if
possible, setting reset-time to FALSE fixes that problem.

Also, it's not necessary to fabricate a segment. Since we are not
seeking, only the base needs to be adjusted, and gstbasesrc already
handles this correctly by default.

This fixes an audio/video synchronization bug in YT when some
automatic quality changes occur.

Tests: imported/w3c/web-platform-tests/media-source/mediasource-correct-frames-after-reappend.html
       imported/w3c/web-platform-tests/media-source/mediasource-correct-frames.html

* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::flush):

LayoutTests:

Drawing an MSE video in a canvas seems to be failing in Mac. That
functionality is necessary for the tests introduced with this patch,
therefore they fail there. Marking them as Skip.

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-correct-frames-after-reappend-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-correct-frames-after-reappend.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-correct-frames-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-correct-frames.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/media-source/mp4/test-boxes-audio.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/media-source/mp4/test-boxes-video.mp4 [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/mse/PlaybackPipeline.cpp