Bug 206412 - [MSE] Decode glitches when watching videos on CNN.com
Summary: [MSE] Decode glitches when watching videos on CNN.com
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-17 06:41 PST by Jer Noble
Modified: 2020-01-17 13:04 PST (History)
8 users (show)

See Also:


Attachments
Patch (10.26 KB, patch)
2020-01-17 06:56 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (11.01 KB, patch)
2020-01-17 10:11 PST, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2020-01-17 06:41:42 PST
[MSE] Decode glitches when watching videos on CNN.com
Comment 1 Jer Noble 2020-01-17 06:42:49 PST
<rdar://problem/55685630>
Comment 2 Jer Noble 2020-01-17 06:56:55 PST
Created attachment 388034 [details]
Patch
Comment 3 Alicia Boya García 2020-01-17 08:08:47 PST
Comment on attachment 388034 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=388034&action=review

Looks good to me.

> Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1680
> +        // When appending media containing P-frames (media whose samples' presentation timestamps

I think you mean B-frames. A movie with only I-frames and P-frames has monotonic presentation timestamps, and usually PTS=DTS.

> Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1691
> +            auto nextDecodedSample = trackBuffer.samples.decodeOrder().findSampleAfterDecodeKey(decodeKey);

nextDecodeSample, nextSampleDTS, nextSampleInDecodeOrder or even just nextSample.

> Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1699
> +            if (nextSyncSample == nextDecodedSample)

The only way this could be true is if nextDecodeSample == end(), but that was checked already above.
Comment 4 Xabier Rodríguez Calvar 2020-01-17 08:13:40 PST
Comment on attachment 388034 [details]
Patch

Thanks Alicia!
Comment 5 Jer Noble 2020-01-17 09:11:33 PST
(In reply to Alicia Boya García from comment #3)
> Comment on attachment 388034 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=388034&action=review
> 
> Looks good to me.
> 
> > Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1680
> > +        // When appending media containing P-frames (media whose samples' presentation timestamps
> 
> I think you mean B-frames. A movie with only I-frames and P-frames has
> monotonic presentation timestamps, and usually PTS=DTS.

Whoops, looks like I got that... backwards.
> > Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1691
> > +            auto nextDecodedSample = trackBuffer.samples.decodeOrder().findSampleAfterDecodeKey(decodeKey);
> 
> nextDecodeSample, nextSampleDTS, nextSampleInDecodeOrder or even just
> nextSample.

As you can tell from SampleMap, I don’t mind long, descriptive names, so maybe I’ll go with “nextSampleInDecodeOrder”.

> > Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1699
> > +            if (nextSyncSample == nextDecodedSample)
> 
> The only way this could be true is if nextDecodeSample == end(), but that
> was checked already above.

Good catch!
Comment 6 Jer Noble 2020-01-17 10:11:35 PST
Created attachment 388053 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2020-01-17 13:03:59 PST
Comment on attachment 388053 [details]
Patch for landing

Clearing flags on attachment: 388053

Committed r254761: <https://trac.webkit.org/changeset/254761>
Comment 8 WebKit Commit Bot 2020-01-17 13:04:01 PST
All reviewed patches have been landed.  Closing bug.