Bug 220555 - [Mac] MediaSampleCursor::stepInOrderedMap can hang when stepping to the end of a track that hasn't been fully parsed
Summary: [Mac] MediaSampleCursor::stepInOrderedMap can hang when stepping to the end o...
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: Andy Estes
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-12 11:41 PST by Andy Estes
Modified: 2021-01-27 01:07 PST (History)
7 users (show)

See Also:


Attachments
Patch (52.58 KB, patch)
2021-01-12 11:42 PST, Andy Estes
no flags Details | Formatted Diff | Diff
Patch (2.05 MB, patch)
2021-01-26 10:40 PST, Andy Estes
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2021-01-12 11:41:40 PST
[Mac] MediaSampleCursor::stepInOrderedMap can hang when stepping to the end of a track that hasn't been fully parsed
Comment 1 Andy Estes 2021-01-12 11:42:28 PST
Created attachment 417474 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2021-01-19 11:42:13 PST
<rdar://problem/73366041>
Comment 3 Eric Carlson 2021-01-25 14:13:41 PST
Comment on attachment 417474 [details]
Patch

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

Some of the ALWAYS_LOG should be changed to DEBUG_LOG.

r=me

> Source/WebCore/platform/Logging.h:81
> +    M(MediaFormatReader) \

Having a dedicated log channel has some benefits, but using Media would allow us to configure the log level from the WebInspector.

> Source/WebKit/Shared/mac/MediaFormatReader/MediaSampleCursor.cpp:54
> +String LogArgument<CFComparisonResult>::toString(CFComparisonResult comparisonResult)

It would be more efficient to return a `ASCIILiteral` here and below where we return literals.

> Source/WebKit/Shared/mac/MediaFormatReader/MediaSampleCursor.cpp:245
> +static MediaTime makeDuration(typename OrderedMap::iterator iterator, OrderedMap& samples, const MediaTime& trackDuration)

Nit: "makeDuration" implies, to me, that this will set the duration of something. Maybe `calculateDuration` instead?

> Source/WebKit/Shared/mac/MediaFormatReader/MediaSampleCursor.cpp:270
> +    PresentationTime presentationTime { time };

Is there a reason to create a local variable here?

> Source/WebKit/Shared/mac/MediaFormatReader/MediaSampleCursor.cpp:276
> +    DecodeTime decodeTime { std::make_pair(time, time) };

Ditto
Comment 4 Andy Estes 2021-01-26 10:40:03 PST
Created attachment 418445 [details]
Patch
Comment 5 EWS 2021-01-27 01:07:41 PST
Committed r271939: <https://trac.webkit.org/changeset/271939>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418445 [details].