Bug 159230 - Cannot clear a MediaSource SourceBuffer in Safari 9 and WebKit nightly
Summary: Cannot clear a MediaSource SourceBuffer in Safari 9 and WebKit nightly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari 9
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL: http://storage.googleapis.com/shaka-d...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-06-28 15:04 PDT by Joey Parrish
Modified: 2016-10-31 09:17 PDT (History)
8 users (show)

See Also:


Attachments
Patch (5.15 KB, patch)
2016-06-29 09:56 PDT, Jer Noble
eric.carlson: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-yosemite (799.15 KB, application/zip)
2016-06-29 10:43 PDT, Build Bot
no flags Details
Patch for landing (5.83 KB, patch)
2016-06-29 10:49 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews113 for mac-yosemite (1.42 MB, application/zip)
2016-06-29 11:02 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews107 for mac-yosemite-wk2 (833.57 KB, application/zip)
2016-06-29 12:47 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joey Parrish 2016-06-28 15:04:36 PDT
Shaka Player (https://github.com/google/shaka-player) discovered that Safari does not completely remove buffered ranges.

In our test, we append 30 seconds of data (from 0 to about 30s), then remove from 0 to 60.  Even though this removal encompasses all data in buffer, Safari leaves behind a tiny buffered range (less than 1 trillionth of a second).  This causes confusion in MSE apps like ours which make decisions based on where the end of the buffer is.

To reproduce:

1. Visit http://storage.googleapis.com/shaka-demo-assets/_bugs/safari-mse-clear/index.html in Safari
2. Open the JavaScript console
3. Observe information about the steps that were taken

In Chrome, Firefox, Opera, Edge, and IE 11, the result is that nothing is buffered after removing the range from 0-60.

In Safari 9, the result is that there is still a buffered range.  You will see a failed assertion in the console after loading our test page.

OS X El Capitan, Safari 9.0.3 (11601.4.4) and in WebKit nightly r202569.
Comment 1 Radar WebKit Bug Importer 2016-06-29 09:54:50 PDT
<rdar://problem/27082033>
Comment 2 Jer Noble 2016-06-29 09:56:47 PDT
Created attachment 282354 [details]
Patch
Comment 3 Build Bot 2016-06-29 10:43:13 PDT
Comment on attachment 282354 [details]
Patch

Attachment 282354 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1595307

New failing tests:
media/media-source/media-source-remove.html
Comment 4 Build Bot 2016-06-29 10:43:17 PDT
Created attachment 282357 [details]
Archive of layout-test-results from ews103 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 5 Jer Noble 2016-06-29 10:49:39 PDT
Created attachment 282358 [details]
Patch for landing
Comment 6 Build Bot 2016-06-29 11:01:57 PDT
Comment on attachment 282354 [details]
Patch

Attachment 282354 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1595342

New failing tests:
media/media-source/media-source-remove.html
Comment 7 Build Bot 2016-06-29 11:02:00 PDT
Created attachment 282359 [details]
Archive of layout-test-results from ews113 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 8 Brent Fulgham 2016-06-29 11:51:58 PDT
Comment on attachment 282358 [details]
Patch for landing

Looks good! r=me.
Comment 9 WebKit Commit Bot 2016-06-29 12:23:23 PDT
Comment on attachment 282358 [details]
Patch for landing

Clearing flags on attachment: 282358

Committed r202641: <http://trac.webkit.org/changeset/202641>
Comment 10 Build Bot 2016-06-29 12:47:42 PDT
Comment on attachment 282354 [details]
Patch

Attachment 282354 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1595944

New failing tests:
media/media-source/media-source-remove.html
Comment 11 Build Bot 2016-06-29 12:47:46 PDT
Created attachment 282364 [details]
Archive of layout-test-results from ews107 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 12 Lucas Cheon 2016-08-18 14:55:51 PDT
I'm experience exact same problem as Joey is having with Shaka Player on Safari 10 Beta.

I see that Jer has been working on making fixes here. When can we expect the fixes to be applied?
Comment 13 Jer Noble 2016-10-31 09:17:16 PDT
(In reply to comment #12)
> I'm experience exact same problem as Joey is having with Shaka Player on
> Safari 10 Beta.
> 
> I see that Jer has been working on making fixes here. When can we expect the
> fixes to be applied?

Lucas, we've made a lot of changes since this patch landed. Can you file a new Bugzilla if you're still seeing issues with Shaka Player?