WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 139075
[MSE] Unset timestamps of trackbuffers during Reset Parser State algorithm
https://bugs.webkit.org/show_bug.cgi?id=139075
Summary
[MSE] Unset timestamps of trackbuffers during Reset Parser State algorithm
Bartlomiej Gajda
Reported
2014-11-27 05:41:27 PST
Specification in here:
http://www.w3.org/TR/2014/CR-media-source-20140717/#sourcebuffer-reset-parser-state
requires from us to unset timestamps for track buffers on abort().
Attachments
proposed patch
(3.54 KB, patch)
2014-11-27 05:43 PST
,
Bartlomiej Gajda
sam
: review-
Details
Formatted Diff
Diff
Patch with LayoutTest as suggested by Jer Noble
(7.66 KB, patch)
2014-12-01 08:05 PST
,
Bartlomiej Gajda
jer.noble
: review+
Details
Formatted Diff
Diff
Patch with LayoutTest , fixed style
(7.53 KB, patch)
2014-12-01 09:49 PST
,
Bartlomiej Gajda
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Bartlomiej Gajda
Comment 1
2014-11-27 05:43:31 PST
Created
attachment 242251
[details]
proposed patch perhaps m_private->abort() should be renamed to m_private->resetParserState() ?
Sam Weinig
Comment 2
2014-11-28 23:08:44 PST
Seems like this needs a test case.
Jer Noble
Comment 3
2014-11-29 13:12:38 PST
(In reply to
comment #2
)
> Seems like this needs a test case.
Yep. You could write a test case using the Mock media source that pushes in a random-access sample, then resets the parser state and pushes in non-random-access samples and verifies that those samples were discarded and not enqueued.
Sam Weinig
Comment 4
2014-11-29 13:55:28 PST
Comment on
attachment 242251
[details]
proposed patch r- for tests.
Bartlomiej Gajda
Comment 5
2014-12-01 08:05:02 PST
Created
attachment 242312
[details]
Patch with LayoutTest as suggested by Jer Noble Added sample layout test which adds 4 samples, adds and aborts fifth append, and then tries to add 5 more non sync samples. After all of that checks for dropped samples, and duration. Shall be enough to test this?
Jer Noble
Comment 6
2014-12-01 08:56:44 PST
Comment on
attachment 242312
[details]
Patch with LayoutTest as suggested by Jer Noble View in context:
https://bugs.webkit.org/attachment.cgi?id=242312&action=review
r=me, with nits in the new layout test. Please upload a new version, and I'll cq+ it.
> LayoutTests/media/media-source/media-source-append-nonsync-sample-after-abort.html:34 > + nextRequest = 0; > +
No need to re-initialize this variable here.
> LayoutTests/media/media-source/media-source-append-nonsync-sample-after-abort.html:40 > + function finishTest() {
It would be better if this function came after `sourceUpdated()`.
> LayoutTests/media/media-source/media-source-append-nonsync-sample-after-abort.html:44 > + /* > + Only first sample was sync, after abort there were only non sync samples, so they should be dropped, > + as trackBuffer will have needsRandomAccessPoint set. > + */
This comment should go in the ChangeLog, instead of in the test.
> LayoutTests/media/media-source/media-source-append-nonsync-sample-after-abort.html:47 > + var droppedAmount = sampleCount - abortAfter - 1; // 1 sample will be canceled
Since this variable is just subtracting constant values from one another, you can just define this up at the top of the file with the other const values.
> LayoutTests/media/media-source/media-source-append-nonsync-sample-after-abort.html:61 > + if (nextRequest < sampleCount) { > + sourceBuffer.appendBuffer( > + makeASample(nextRequest, nextRequest, 1, 1, > + (nextRequest == 0) ? SAMPLE_FLAG.SYNC : SAMPLE_FLAG.NONE > + )); > + } > + else { > + finishTest(); > + }
WebKit style has you invert the "if()" logic, call finishTest(), and return early.
> LayoutTests/media/media-source/media-source-append-nonsync-sample-after-abort.html:65 > + if (nextRequest == abortAfter) { > + sourceBuffer.abort(); // need to do this after appendBuffer, before `updateend` > + }
WebKit style also has you remove the braces from single-line if clauses. I don't think the comment is necessary.
> LayoutTests/media/media-source/media-source-append-nonsync-sample-after-abort.html:72 > + <video controls width=960 height=510></video>
No need to specify a width and height here.
Bartlomiej Gajda
Comment 7
2014-12-01 09:49:20 PST
Created
attachment 242317
[details]
Patch with LayoutTest , fixed style
> No need to re-initialize this variable here.
> It would be better if this function came after `sourceUpdated()`.
> This comment should go in the ChangeLog, instead of in the test.
> Since this variable is just subtracting constant values from one another, > you can just define this up at the top of the file with the other const > values.
> WebKit style has you invert the "if()" logic, call finishTest(), and return > early.
> WebKit style also has you remove the braces from single-line if clauses. I > don't think the comment is necessary.
> No need to specify a width and height here.
Fixed above, thanks!
WebKit Commit Bot
Comment 8
2014-12-01 11:01:27 PST
Comment on
attachment 242317
[details]
Patch with LayoutTest , fixed style Clearing flags on attachment: 242317 Committed
r176594
: <
http://trac.webkit.org/changeset/176594
>
WebKit Commit Bot
Comment 9
2014-12-01 11:01:33 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug