WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
237473
MediaTime::invalidTime() isn't convertible without loss into CMTime
https://bugs.webkit.org/show_bug.cgi?id=237473
Summary
MediaTime::invalidTime() isn't convertible without loss into CMTime
Jean-Yves Avenard [:jya]
Reported
2022-03-04 07:49:17 PST
Consider the following code: ``` auto invalid = MediaTime::invalidTime(); auto cminvalid = PAL::toCMTime(invalid); auto invalid2 = PAL::toMediaTime(cminvalid); ASSERT(invalid == invalid2); ``` the assertion will fail. The reason is that PAL::toCMTime(MediaTime::invalidTime()) will generate a CMTime that has the flag kCMTimeFlags_HasBeenRounded set. This causes failure here
https://webkit-search.igalia.com/webkit/rev/ceb5e25a803df6cd6ea1c45859e4e03bbf659f75/Source/WebKit/Shared/mac/MediaFormatReader/MediaSampleByteRange.cpp#49
Attachments
Patch
(3.00 KB, patch)
2022-03-04 08:37 PST
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Patch
(11.32 KB, patch)
2022-03-04 19:31 PST
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Patch
(11.36 KB, patch)
2022-03-04 19:33 PST
,
Jean-Yves Avenard [:jya]
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(18.08 KB, patch)
2022-03-04 19:47 PST
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Patch
(17.61 KB, patch)
2022-03-07 13:58 PST
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Patch
(17.60 KB, patch)
2022-03-07 14:00 PST
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Show Obsolete
(5)
View All
Add attachment
proposed patch, testcase, etc.
Jean-Yves Avenard [:jya]
Comment 1
2022-03-04 07:56:59 PST
Actually, earlier description is incorrect: the code of toCMTime is as follow: ``` CMTime time; if (mediaTime.hasDoubleValue()) time = CMTimeMakeWithSeconds(mediaTime.toDouble(), mediaTime.timeScale()); else time = CMTimeMake(mediaTime.timeValue(), mediaTime.timeScale()); if (mediaTime.isValid()) time.flags |= kCMTimeFlags_Valid; if (mediaTime.hasBeenRounded()) time.flags |= kCMTimeFlags_HasBeenRounded; if (mediaTime.isPositiveInfinite()) time.flags |= kCMTimeFlags_PositiveInfinity; if (mediaTime.isNegativeInfinite()) time.flags |= kCMTimeFlags_NegativeInfinity; return time; ``` what converting MediaTime::invalidTime() : `CMTimeMake(mediaTime.timeValue(), mediaTime.timeScale());` will return a valid time and that flag isn't reset.
Radar WebKit Bug Importer
Comment 2
2022-03-04 08:23:52 PST
<
rdar://problem/89814921
>
Jean-Yves Avenard [:jya]
Comment 3
2022-03-04 08:37:13 PST
Created
attachment 453845
[details]
Patch
Jean-Yves Avenard [:jya]
Comment 4
2022-03-04 19:31:35 PST
Created
attachment 453886
[details]
Patch
Jean-Yves Avenard [:jya]
Comment 5
2022-03-04 19:33:03 PST
Created
attachment 453887
[details]
Patch
Jean-Yves Avenard [:jya]
Comment 6
2022-03-04 19:47:20 PST
Created
attachment 453888
[details]
Patch Fix iOS compilation
Jer Noble
Comment 7
2022-03-07 13:53:18 PST
Comment on
attachment 453888
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=453888&action=review
> Source/WebCore/PAL/ChangeLog:15 > +2022-03-04 Jean-Yves Avenard <
jya@apple.com
>
Nit: This ChangeLog entry should get merged with the one above it.
Jean-Yves Avenard [:jya]
Comment 8
2022-03-07 13:58:23 PST
Created
attachment 454028
[details]
Patch
Jean-Yves Avenard [:jya]
Comment 9
2022-03-07 14:00:27 PST
Created
attachment 454031
[details]
Patch
EWS
Comment 10
2022-03-07 16:01:42 PST
Committed
r290964
(
248144@main
): <
https://commits.webkit.org/248144@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 454031
[details]
.
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