Closed
Bug 1118589
Opened 11 years ago
Closed 11 years ago
MSE: SourceBuffer::appendBuffer doesn't fill the buffer asynchronously
Categories
(Core :: Audio/Video, defect, P2)
Core
Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: jya, Assigned: jya)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
6.97 KB,
patch
|
Sylvestre
:
approval-mozilla-aurora+
Sylvestre
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
As per spec:
http://w3c.github.io/media-source/#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data:
"5. Asynchronously run the buffer append algorithm."
Currently the entire SourceBuffer::appendBuffer is done synchronously. This is causing an issue with bug 1118126.
For example, one problem of not running asynchronously could be:
var ms = new MediaSource();
var sb = new SourceBuffer();
ms.duration = 0; // this queue a secondary task that will change the duration
sb.appendBuffer(data); // this adds data to the source buffer.
Now the queue task that will set the duration is run and (with bug 1118126 fixed) will clear all data in the source buffer found after timestamp 0.
We now have a cleared source buffer.
Either setting the mediasource duration has to be done so that it's not processed asynchronously in a separate task; or make appendBuffer queue the task so it always occur after an earlier operation has completed.
Updated•11 years ago
|
Priority: -- → P2
Assignee | ||
Comment 1•11 years ago
|
||
Run appendBuffer's internal asynchronously rather than just the updateend event. I ponder if it would have been better to use NS_NewRunnableMethodWithArg with a nsTArary instead, as the change would have been smaller, but it would have doubled the memory usage (albeit temporarily)
Attachment #8545655 -
Flags: review?(ajones)
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → jyavenard
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•11 years ago
|
||
Comment on attachment 8545655 [details] [diff] [review]
[MSE] Run appendBuffer internal's asynchronously
I think cajbir is more suited for the review.
Plus I can see some issues with the order of events.
Attachment #8545655 -
Flags: review?(ajones)
Assignee | ||
Comment 3•11 years ago
|
||
Add check if sourcebuffer was aborted before task got the chance to run
Attachment #8545671 -
Flags: review?(cajbir.bugzilla)
Assignee | ||
Updated•11 years ago
|
Attachment #8545655 -
Attachment is obsolete: true
Comment 4•11 years ago
|
||
Comment on attachment 8545671 [details] [diff] [review]
[MSE] Run appendBuffer internal's asynchronously
Review of attachment 8545671 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/media/mediasource/SourceBuffer.cpp
@@ +39,5 @@
> namespace mozilla {
>
> namespace dom {
>
> +class AppendDataRunnable : public nsRunnable {
Add comment explaining what this class is for.
@@ +41,5 @@
> namespace dom {
>
> +class AppendDataRunnable : public nsRunnable {
> +public:
> + explicit AppendDataRunnable(SourceBuffer* aSourceBuffer,
'explicit' isn't needed in multi argument constructors and is ignored by the compiler.
@@ +49,5 @@
> + {
> + mData.AppendElements(aData, aLength);
> + }
> +
> + NS_IMETHOD Run() MOZ_OVERRIDE MOZ_FINAL {
This does a lot of stuff internal to mSourceBuffer. How about move it all to a method of SourceBuffer and just call that method from Run(). Then you don't need to do all the mSourceBuffer-> stuff.
Attachment #8545671 -
Flags: review?(cajbir.bugzilla) → review+
Assignee | ||
Comment 5•11 years ago
|
||
Carrying r+. Move code to SourceBuffer class, and re-base to support timestampOffset
Assignee | ||
Updated•11 years ago
|
Attachment #8545671 -
Attachment is obsolete: true
Assignee | ||
Comment 6•11 years ago
|
||
Assignee | ||
Comment 7•11 years ago
|
||
Since bug 1119456, try has been failing test_eme_playback.patch on all non-debug build but windows
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7fd45ecd1603
Assignee | ||
Comment 8•11 years ago
|
||
Rebase...
Assignee | ||
Updated•11 years ago
|
Attachment #8546299 -
Attachment is obsolete: true
Assignee | ||
Comment 9•11 years ago
|
||
Comment 10•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Comment 11•11 years ago
|
||
Comment on attachment 8554417 [details] [diff] [review]
MSE: Run appendBuffer internal's asynchronously
Approval Request Comment
[Feature/regressing bug #]: MSE
[User impact if declined]: Less consistent testing, sites more likely to serve Flash video.
[Describe test coverage new/current, TreeHerder]: Landed on m-c.
[Risks and why]: This fixes a spec compliance issue and is MSE-specific. We don't know that it's critical for youtube, but I think the the churn is worthwhile to remove the branch variance.
[String/UUID change made/needed]: None.
Attachment #8554417 -
Flags: approval-mozilla-beta?
Attachment #8554417 -
Flags: approval-mozilla-aurora?
Updated•11 years ago
|
Updated•11 years ago
|
Attachment #8554417 -
Flags: approval-mozilla-beta?
Attachment #8554417 -
Flags: approval-mozilla-beta+
Attachment #8554417 -
Flags: approval-mozilla-aurora?
Attachment #8554417 -
Flags: approval-mozilla-aurora+
Comment 12•11 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•