Changeset 86163 in webkit


Ignore:
Timestamp:
May 10, 2011 10:08:10 AM (13 years ago)
Author:
eric.carlson@apple.com
Message:

2011-05-10 Eric Carlson <eric.carlson@apple.com>

Reviewed by Darin Adler.

Files that load quickly sometimes won't play.
https://bugs.webkit.org/show_bug.cgi?id=60556
<rdar://problem/9330567>

No new tests, this failure is very difficult to reproduce on some machines. The fix was
verified manually.

  • platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::playabilityKnown): Move the call to updateStates

to dispatchNotification so it is more obvious which state changes call it.

(WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize): Correct logging typo.
(WebCore::MediaPlayerPrivateAVFoundation::metadataLoaded): Move updateStates call to

dispatchNotification.

(WebCore::MediaPlayerPrivateAVFoundation::rateChanged): Ditto.
(WebCore::MediaPlayerPrivateAVFoundation::loadedTimeRangesChanged): Ditto.
(WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification): Call updateStates after

processing "size changed" notification so we detect all state changes. Consolidate
calls to updateStates here.

  • platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer): Name the video layer in

a debug build.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86160 r86163  
     12011-05-10  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Files that load quickly sometimes won't play.
     6        https://bugs.webkit.org/show_bug.cgi?id=60556
     7        <rdar://problem/9330567>
     8
     9        No new tests, this failure is very difficult to reproduce on some machines. The fix was
     10        verified manually.
     11
     12        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
     13        (WebCore::MediaPlayerPrivateAVFoundation::playabilityKnown): Move the call to updateStates
     14            to dispatchNotification so it is more obvious which state changes call it.
     15        (WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize): Correct logging typo.
     16        (WebCore::MediaPlayerPrivateAVFoundation::metadataLoaded): Move updateStates call to
     17            dispatchNotification.
     18        (WebCore::MediaPlayerPrivateAVFoundation::rateChanged): Ditto.
     19        (WebCore::MediaPlayerPrivateAVFoundation::loadedTimeRangesChanged): Ditto.
     20        (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification): Call updateStates after
     21            processing "size changed" notification so we detect all state changes. Consolidate
     22            calls to updateStates here.
     23
     24        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.mm:
     25        (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer): Name the video layer in
     26            a debug build.
     27
    1282011-05-10  Abhishek Arya  <inferno@chromium.org>
    229
  • trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp

    r85913 r86163  
    191191    LOG(Media, "MediaPlayerPrivateAVFoundation::playabilityKnown(%p)", this);
    192192
    193     updateStates();
    194193    if (m_assetIsPlayable)
    195194        return;
     
    306305void MediaPlayerPrivateAVFoundation::setNaturalSize(IntSize size)
    307306{
    308     LOG(Media, "MediaPlayerPrivateAVFoundation:sizeChanged(%p) - size = %d x %d", this, size.width(), size.height());
     307    LOG(Media, "MediaPlayerPrivateAVFoundation:setNaturalSize(%p) - size = %d x %d", this, size.width(), size.height());
    309308
    310309    IntSize oldSize = m_cachedNaturalSize;
     
    506505    m_loadingMetadata = false;
    507506    tracksChanged();
    508     updateStates();
    509507}
    510508
    511509void MediaPlayerPrivateAVFoundation::rateChanged()
    512510{
    513     updateStates();
    514511    m_player->rateChanged();
    515512}
     
    519516    m_cachedLoadedTimeRanges = 0;
    520517    m_cachedMaxTimeLoaded = 0;
    521     updateStates();
    522518
    523519    // For some media files, reported duration is estimated and updated as media is loaded
     
    728724    case Notification::ItemSeekableTimeRangesChanged:
    729725        seekableTimeRangesChanged();
     726        updateStates();
    730727        break;
    731728    case Notification::ItemLoadedTimeRangesChanged:
    732729        loadedTimeRangesChanged();
     730        updateStates();
    733731        break;
    734732    case Notification::ItemPresentationSizeChanged:
     
    746744        break;
    747745    case Notification::PlayerRateChanged:
     746        updateStates();
    748747        rateChanged();
    749748        break;
     
    756755    case Notification::AssetMetadataLoaded:
    757756        metadataLoaded();
     757        updateStates();
    758758        break;
    759759    case Notification::AssetPlayabilityKnown:
     760        updateStates();
    760761        playabilityKnown();
    761762        break;
  • trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.mm

    r85918 r86163  
    221221        m_videoLayer.adoptNS([[AVPlayerLayer alloc] init]);
    222222        [m_videoLayer.get() setPlayer:m_avPlayer.get()];
     223#ifndef NDEBUG
     224        [m_videoLayer.get() setName:@"Video layer"];
     225#endif
    223226        LOG(Media, "MediaPlayerPrivateAVFoundationObjC::createVideoLayer(%p) - returning %p", this, m_videoLayer.get());
    224227    }
Note: See TracChangeset for help on using the changeset viewer.