Changeset 167664 in webkit


Ignore:
Timestamp:
Apr 22, 2014 9:56:24 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r167658.
https://bugs.webkit.org/show_bug.cgi?id=131993

Caused many crashes on media tests (Requested by ap on
#webkit).

Reverted changeset:

"[Mac] don't ask for AVAssetTrack properties before they are
available"
https://bugs.webkit.org/show_bug.cgi?id=131902
http://trac.webkit.org/changeset/167658

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r167663 r167664  
     12014-04-22  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r167658.
     4        https://bugs.webkit.org/show_bug.cgi?id=131993
     5
     6        Caused many crashes on media tests (Requested by ap on
     7        #webkit).
     8
     9        Reverted changeset:
     10
     11        "[Mac] don't ask for AVAssetTrack properties before they are
     12        available"
     13        https://bugs.webkit.org/show_bug.cgi?id=131902
     14        http://trac.webkit.org/changeset/167658
     15
    1162014-04-22  David Hyatt  <hyatt@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h

    r167658 r167664  
    321321    double m_cachedDuration;
    322322    double m_cachedRate;
    323     mutable long long m_cachedTotalBytes;
    324323    unsigned m_pendingStatusChanges;
    325324    int m_cachedItemStatus;
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r167658 r167664  
    295295static NSArray *assetMetadataKeyNames();
    296296static NSArray *itemKVOProperties();
    297 static NSArray* assetTrackMetadataKeyNames();
    298297
    299298#if !LOG_DISABLED
     
    367366    , m_cachedDuration(MediaPlayer::invalidTime())
    368367    , m_cachedRate(0)
    369     , m_cachedTotalBytes(0)
    370368    , m_pendingStatusChanges(0)
    371369    , m_cachedItemStatus(MediaPlayerAVPlayerItemStatusDoesNotExist)
     
    786784{
    787785    LOG(Media, "MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata(%p) - requesting metadata loading", this);
    788     dispatch_group_t metadataLoadingGroup = dispatch_group_create();
    789     dispatch_group_enter(metadataLoadingGroup);
    790786    [m_avAsset.get() loadValuesAsynchronouslyForKeys:[assetMetadataKeyNames() retain] completionHandler:^{
    791         if ([m_avAsset.get() statusOfValueForKey:@"tracks" error:nil] == AVKeyValueStatusLoaded) {
    792             for (AVAssetTrack *track in [m_avAsset.get() tracks]) {
    793                 dispatch_group_enter(metadataLoadingGroup);
    794                 [track loadValuesAsynchronouslyForKeys:[assetTrackMetadataKeyNames() retain] completionHandler:^{
    795                     dispatch_group_leave(metadataLoadingGroup);
    796                 }];
    797             }
    798         }
    799         dispatch_group_leave(metadataLoadingGroup);
     787        [m_objcObserver.get() metadataLoaded];
    800788    }];
    801     dispatch_group_notify(metadataLoadingGroup, dispatch_get_main_queue(), ^{
    802         [m_objcObserver.get() metadataLoaded];
    803     });
    804     dispatch_release(metadataLoadingGroup);
    805789}
    806790
     
    11471131        return 0;
    11481132
    1149     if (m_cachedTotalBytes)
    1150         return m_cachedTotalBytes;
    1151 
     1133    long long totalMediaSize = 0;
    11521134    for (AVPlayerItemTrack *thisTrack in m_cachedTracks.get())
    1153         m_cachedTotalBytes += [[thisTrack assetTrack] totalSampleDataLength];
    1154 
    1155     return m_cachedTotalBytes;
     1135        totalMediaSize += [[thisTrack assetTrack] totalSampleDataLength];
     1136
     1137    return totalMediaSize;
    11561138}
    11571139
     
    23622344{
    23632345    m_cachedTracks = tracks;
    2364     m_cachedTotalBytes = 0;
    23652346
    23662347    tracksChanged();
     
    24412422                nil];
    24422423    }
    2443     return keys;
    2444 }
    2445 
    2446 NSArray* assetTrackMetadataKeyNames()
    2447 {
    2448     static NSArray* keys;
    2449     if (!keys)
    2450         keys = @[@"totalSampleDataLength", @"mediaType"];
    2451 
    24522424    return keys;
    24532425}
Note: See TracChangeset for help on using the changeset viewer.