Changeset 188416 in webkit


Ignore:
Timestamp:
Aug 13, 2015 4:39:01 PM (9 years ago)
Author:
jer.noble@apple.com
Message:

Don't short circuit seeking
https://bugs.webkit.org/show_bug.cgi?id=147892

Reviewed by Eric Carlson.

When two seekWithTolerance() requests come in before the first is acted upon in seekTask(),
the second will result in a "no seek required" conditional, because the new "currentTime" is
assumed to be the destination time of the first seek.

When cancelling a pending seek, first replace the "now" value with the "now" value from the
replaced seek, thus preserving the original currentTime across all replacement seeks.

Drive-by fix: some added logging causes occasional crashes, due to the underlying object being
accessed having been deleted.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::seekWithTolerance):

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

(WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r188411 r188416  
     12015-08-13  Jer Noble  <jer.noble@apple.com>
     2
     3        Don't short circuit seeking
     4        https://bugs.webkit.org/show_bug.cgi?id=147892
     5
     6        Reviewed by Eric Carlson.
     7
     8        When two seekWithTolerance() requests come in before the first is acted upon in seekTask(),
     9        the second will result in a "no seek required" conditional, because the new "currentTime" is
     10        assumed to be the destination time of the first seek.
     11
     12        When cancelling a pending seek, first replace the "now" value with the "now" value from the
     13        replaced seek, thus preserving the original currentTime across all replacement seeks.
     14
     15        Drive-by fix: some added logging causes occasional crashes, due to the underlying object being
     16        accessed having been deleted.
     17
     18        * html/HTMLMediaElement.cpp:
     19        (WebCore::HTMLMediaElement::seekWithTolerance):
     20        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     21        (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
     22
    1232015-08-13  Brent Fulgham  <bfulgham@apple.com>
    224
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r188390 r188416  
    24962496        LOG(Media, "HTMLMediaElement::seekWithTolerance(%p) - cancelling pending seeks", this);
    24972497        m_seekTaskQueue.cancelAllTasks();
    2498         m_pendingSeek = nullptr;
     2498        if (m_pendingSeek) {
     2499            now = m_pendingSeek->now;
     2500            m_pendingSeek = nullptr;
     2501        }
    24992502        m_pendingSeekType = NoSeek;
    25002503    }
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r188390 r188416  
    13091309
    13101310    [m_avPlayerItem.get() seekToTime:cmTime toleranceBefore:cmBefore toleranceAfter:cmAfter completionHandler:^(BOOL finished) {
    1311         double currentTime = CMTimeGetSeconds([m_avPlayerItem currentTime]);
    1312         callOnMainThread([weakThis, finished, currentTime] {
    1313             UNUSED_PARAM(currentTime);
     1311        callOnMainThread([weakThis, finished] {
    13141312            auto _this = weakThis.get();
    1315             LOG(Media, "MediaPlayerPrivateAVFoundationObjC::seekToTime(%p) - completion handler called, currentTime = %f", _this, currentTime);
    13161313            if (!_this)
    13171314                return;
Note: See TracChangeset for help on using the changeset viewer.