Title: [289827] branches/safari-613.1.17.0-branch/Source/WebCore
Revision
289827
Author
[email protected]
Date
2022-02-15 10:45:35 -0800 (Tue, 15 Feb 2022)

Log Message

Cherry-pick r289762. rdar://problem/88786989

    REGRESSION(r286560): MediaElement's getStartDate returning an incorrect time
    https://bugs.webkit.org/show_bug.cgi?id=236360
    <rdar://problem/88786989>

    Reviewed by Eric Carlson.

    r286560 changed IDL `Date` to use `WallTime` instead of a raw `double`, meaning that
    `HTMLMediaElement::getStartDate` now did extra processing of the `MediaTime` returned by
    `MediaPlayer::getStartDate`.

    Unfortunately, `MediaPlayerPrivateAVFoundationObjC::getStartDate` returned a `MediaTime`
    represented in milliseconds (due to two `* 1000`), even though `MediaTime` is supposed to be
    seconds-based.

    As a result, the changes in r286560 inadvertently caused two `* 1000` on the same time value.

    Covered by existing test (`LayoutTests/http/tests/media/hls/video-controller-getStartDate.html`).
    Note that the test was marked as `[Pass Failure]` before r286560.

    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
    (WebCore::MediaPlayerPrivateAVFoundationObjC::getStartDate const):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289762 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-613.1.17.0-branch/Source/WebCore/ChangeLog (289826 => 289827)


--- branches/safari-613.1.17.0-branch/Source/WebCore/ChangeLog	2022-02-15 18:45:31 UTC (rev 289826)
+++ branches/safari-613.1.17.0-branch/Source/WebCore/ChangeLog	2022-02-15 18:45:35 UTC (rev 289827)
@@ -1,5 +1,58 @@
 2022-02-15  Russell Epstein  <[email protected]>
 
+        Cherry-pick r289762. rdar://problem/88786989
+
+    REGRESSION(r286560): MediaElement's getStartDate returning an incorrect time
+    https://bugs.webkit.org/show_bug.cgi?id=236360
+    <rdar://problem/88786989>
+    
+    Reviewed by Eric Carlson.
+    
+    r286560 changed IDL `Date` to use `WallTime` instead of a raw `double`, meaning that
+    `HTMLMediaElement::getStartDate` now did extra processing of the `MediaTime` returned by
+    `MediaPlayer::getStartDate`.
+    
+    Unfortunately, `MediaPlayerPrivateAVFoundationObjC::getStartDate` returned a `MediaTime`
+    represented in milliseconds (due to two `* 1000`), even though `MediaTime` is supposed to be
+    seconds-based.
+    
+    As a result, the changes in r286560 inadvertently caused two `* 1000` on the same time value.
+    
+    Covered by existing test (`LayoutTests/http/tests/media/hls/video-controller-getStartDate.html`).
+    Note that the test was marked as `[Pass Failure]` before r286560.
+    
+    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+    (WebCore::MediaPlayerPrivateAVFoundationObjC::getStartDate const):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-14  Devin Rousso  <[email protected]>
+
+            REGRESSION(r286560): MediaElement's getStartDate returning an incorrect time
+            https://bugs.webkit.org/show_bug.cgi?id=236360
+            <rdar://problem/88786989>
+
+            Reviewed by Eric Carlson.
+
+            r286560 changed IDL `Date` to use `WallTime` instead of a raw `double`, meaning that
+            `HTMLMediaElement::getStartDate` now did extra processing of the `MediaTime` returned by
+            `MediaPlayer::getStartDate`.
+
+            Unfortunately, `MediaPlayerPrivateAVFoundationObjC::getStartDate` returned a `MediaTime`
+            represented in milliseconds (due to two `* 1000`), even though `MediaTime` is supposed to be
+            seconds-based.
+
+            As a result, the changes in r286560 inadvertently caused two `* 1000` on the same time value.
+
+            Covered by existing test (`LayoutTests/http/tests/media/hls/video-controller-getStartDate.html`).
+            Note that the test was marked as `[Pass Failure]` before r286560.
+
+            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::getStartDate const):
+
+2022-02-15  Russell Epstein  <[email protected]>
+
         Revert r289340. rdar://problem/88629773
 
 2022-02-14  Russell Epstein  <[email protected]>

Modified: branches/safari-613.1.17.0-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (289826 => 289827)


--- branches/safari-613.1.17.0-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2022-02-15 18:45:31 UTC (rev 289826)
+++ branches/safari-613.1.17.0-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2022-02-15 18:45:35 UTC (rev 289827)
@@ -667,13 +667,13 @@
 MediaTime MediaPlayerPrivateAVFoundationObjC::getStartDate() const
 {
     // Date changes as the track's playback position changes. Must subtract currentTime (offset in seconds) from date offset to get date beginning
-    double date = [[m_avPlayerItem currentDate] timeIntervalSince1970] * 1000;
+    double date = [[m_avPlayerItem currentDate] timeIntervalSince1970];
 
     // No live streams were made during the epoch (1970). AVFoundation returns 0 if the media file doesn't have a start date
     if (!date)
         return MediaTime::invalidTime();
 
-    double currentTime = PAL::CMTimeGetSeconds([m_avPlayerItem currentTime]) * 1000;
+    double currentTime = PAL::CMTimeGetSeconds([m_avPlayerItem currentTime]);
 
     // Rounding due to second offset error when subtracting.
     return MediaTime::createWithDouble(round(date - currentTime));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to