Commit 8eadcfb
[MSE][GStreamer] don't push samples while seeking
https://bugs.webkit.org/show_bug.cgi?id=295415
Reviewed by Alicia Boya Garcia.
MediaSource::waitForTarget completes asynchronously. Even when the
target time is already buffered, it still enqueues a task to compute
seek time on next event loop cycle. This can lead to SourceBuffer
providing media data for incorrect time, after GStreamer seek already
flushed the source. For example this happens if
TrackQueue::LowLevelHandler callback was posted just before the seek.
The proposed change implements SourceBufferPrivate::isSeeking() that
returns true until MSE seek is completed, effectivly blocking
SourceBufferPrivate::provideMediaData during the seek.
See: #1528
Original author: Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
* Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): Signal the seek intent to the media source private.
* Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp:
(WebCore::MediaSourcePrivateGStreamer::willSeek): Forward the seek intent to all SourceBufferPrivates.
* Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: Added willSeek().
* Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::willSeek): Set m_isSeeking to true.
(WebCore::SourceBufferPrivateGStreamer::isSeeking const): Return m_isSeeking value.
(WebCore::SourceBufferPrivateGStreamer::seekToTime): Unset m_isSeeking and call the default SourceBufferPrivate seekToTime() implementation.
* Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: Added willSeek(), isSeeking(), seekToTime() and the m_isSeeking flag (to signal that we're waiting for samples from the multiplatform layer after a seek has been initiated; unset once the samples are ready for the platform-specific layer).
Canonical link: https://commits.webkit.org/298330@main1 parent a710083 commit 8eadcfb
5 files changed
Lines changed: 35 additions & 0 deletions
File tree
- Source/WebCore/platform/graphics/gstreamer/mse
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
208 | 214 | | |
209 | 215 | | |
210 | 216 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
406 | 424 | | |
407 | 425 | | |
408 | 426 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
| |||
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
113 | 121 | | |
114 | 122 | | |
115 | 123 | | |
| |||
0 commit comments