WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
172640
MediaTime class has rounding issues in different platforms
https://bugs.webkit.org/show_bug.cgi?id=172640
Summary
MediaTime class has rounding issues in different platforms
Xabier Rodríguez Calvar
Reported
2017-05-26 04:05:33 PDT
MediaTime class has rounding issues in different platforms
Attachments
Patch
(15.44 KB, patch)
2017-05-26 04:18 PDT
,
Xabier Rodríguez Calvar
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews122 for ios-simulator-wk2
(910.61 KB, application/zip)
2017-05-26 05:41 PDT
,
Build Bot
no flags
Details
Patch for landing
(15.40 KB, patch)
2017-06-08 05:33 PDT
,
Xabier Rodríguez Calvar
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Xabier Rodríguez Calvar
Comment 1
2017-05-26 04:18:19 PDT
Created
attachment 311349
[details]
Patch
Build Bot
Comment 2
2017-05-26 05:41:39 PDT
Comment on
attachment 311349
[details]
Patch
Attachment 311349
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
http://webkit-queues.webkit.org/results/3821463
New failing tests: fast/events/before-unload-returnValue.html fast/css/target-fragment-match.html
Build Bot
Comment 3
2017-05-26 05:41:40 PDT
Created
attachment 311350
[details]
Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Xabier Rodríguez Calvar
Comment 4
2017-05-26 08:45:44 PDT
(In reply to Build Bot from
comment #2
)
> New failing tests: > fast/events/before-unload-returnValue.html > fast/css/target-fragment-match.html
These seem unrelated.
Xabier Rodríguez Calvar
Comment 5
2017-05-30 08:28:47 PDT
Please r?
Darin Adler
Comment 6
2017-06-06 14:35:14 PDT
Comment on
attachment 311349
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=311349&action=review
> Source/WTF/wtf/MediaTime.cpp:148 > - return MediaTime(static_cast<int64_t>(doubleTime * timeScale), timeScale, Valid); > + return MediaTime(static_cast<int64_t>(std::round(doubleTime * timeScale)), timeScale, Valid);
I would have expected the old code to truncate, not round, on all platforms. Is rounding what we want here?
> Source/WTF/wtf/MediaTime.cpp:558 > void MediaTime::dump(PrintStream &out) const
Incorrect formatting of PrintStream& here.
Xabier Rodríguez Calvar
Comment 7
2017-06-07 01:43:47 PDT
(In reply to Darin Adler from
comment #6
)
> Comment on
attachment 311349
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=311349&action=review
> > > Source/WTF/wtf/MediaTime.cpp:148 > > - return MediaTime(static_cast<int64_t>(doubleTime * timeScale), timeScale, Valid); > > + return MediaTime(static_cast<int64_t>(std::round(doubleTime * timeScale)), timeScale, Valid); > > I would have expected the old code to truncate, not round, on all platforms. > Is rounding what we want here?
I think rounding is usually better, also in this case
> > Source/WTF/wtf/MediaTime.cpp:558 > > void MediaTime::dump(PrintStream &out) const > > Incorrect formatting of PrintStream& here.
Wdym? I changed it to be like that cause I think it is more informative. In case the stored value is a double we just print that cause the fraction is noise (literally, the double interpreted as integer because it's a union) and in case it is a fraction we print it and as informative value, its representation as double.
Eric Carlson
Comment 8
2017-06-07 06:42:19 PDT
Comment on
attachment 311349
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=311349&action=review
>>> Source/WTF/wtf/MediaTime.cpp:558 >>> void MediaTime::dump(PrintStream &out) const >> >> Incorrect formatting of PrintStream& here. > > Wdym? I changed it to be like that cause I think it is more informative. In case the stored value is a double we just print that cause the fraction is noise (literally, the double interpreted as integer because it's a union) and in case it is a fraction we print it and as informative value, its representation as double.
I think Darin means the "&" should be next to the type, not the variable: void MediaTime::dump(PrintStream& out) const
Eric Carlson
Comment 9
2017-06-07 06:43:14 PDT
Comment on
attachment 311349
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=311349&action=review
>>>> Source/WTF/wtf/MediaTime.cpp:558 >>>> void MediaTime::dump(PrintStream &out) const >>> >>> Incorrect formatting of PrintStream& here. >> >> Wdym? I changed it to be like that cause I think it is more informative. In case the stored value is a double we just print that cause the fraction is noise (literally, the double interpreted as integer because it's a union) and in case it is a fraction we print it and as informative value, its representation as double. > > I think Darin means the "&" should be next to the type, not the variable: > > void MediaTime::dump(PrintStream& out) const
... because that is the preferred WebKit style.
Darin Adler
Comment 10
2017-06-07 08:48:19 PDT
(In reply to Eric Carlson from
comment #8
)
> I think Darin means the "&" should be next to the type, not the variable: > > void MediaTime::dump(PrintStream& out) const
(In reply to Eric Carlson from
comment #9
)
> ... because that is the preferred WebKit style.
Yes, right, that’s what I meant. Sorry my wording was unclear.
Xabier Rodríguez Calvar
Comment 11
2017-06-07 08:53:09 PDT
(In reply to Darin Adler from
comment #10
)
> (In reply to Eric Carlson from
comment #8
) > > I think Darin means the "&" should be next to the type, not the variable: > > > > void MediaTime::dump(PrintStream& out) const > > (In reply to Eric Carlson from
comment #9
) > > ... because that is the preferred WebKit style. > > Yes, right, that’s what I meant. Sorry my wording was unclear.
Sure! I hadn't even noticed but because that was not part of the patch, but I can change that. Might I have and r+ cq- so that I can land with that change?
Darin Adler
Comment 12
2017-06-07 08:56:46 PDT
Sure, but I think it should be someone who works on the media code and has more expertise than I. I didn’t review because I’m not familiar enough with all the uses of MediaTime to be sure that the change to rounding is safe and helpful. I suspect it is, but I would like someone else to make the call.
Jer Noble
Comment 13
2017-06-07 09:05:59 PDT
(In reply to Darin Adler from
comment #12
)
> Sure, but I think it should be someone who works on the media code and has > more expertise than I. I didn’t review because I’m not familiar enough with > all the uses of MediaTime to be sure that the change to rounding is safe and > helpful. I suspect it is, but I would like someone else to make the call.
Looks fine to me.
Xabier Rodríguez Calvar
Comment 14
2017-06-08 05:33:00 PDT
Created
attachment 312296
[details]
Patch for landing
WebKit Commit Bot
Comment 15
2017-06-08 06:10:55 PDT
Comment on
attachment 312296
[details]
Patch for landing Clearing flags on attachment: 312296 Committed
r217928
: <
http://trac.webkit.org/changeset/217928
>
WebKit Commit Bot
Comment 16
2017-06-08 06:10:56 PDT
All reviewed patches have been landed. Closing bug.
Xabier Rodríguez Calvar
Comment 17
2017-06-08 09:56:17 PDT
I am unsure about:
https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#tests=media%2Fmodern-media-controls%2Fbuttons-container%2Fbuttons-container-buttons-property.html&revision=217791
https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#tests=media%2Fvideo-seek-with-negative-playback.html
I'll check it back tomorrow but if you're sure it's a problem, we could roll back if urgent.
Xabier Rodríguez Calvar
Comment 18
2017-06-09 01:10:46 PDT
(In reply to Xabier Rodríguez Calvar from
comment #17
)
> I am unsure about: > >
https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard
. > html#tests=media%2Fmodern-media-controls%2Fbuttons-container%2Fbuttons- > container-buttons-property.html&revision=217791 > >
https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard
. > html#tests=media%2Fvideo-seek-with-negative-playback.html
Flakiness dashboard says they are ok.
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