Title: [167664] trunk/Source/WebCore
Revision
167664
Author
commit-qu...@webkit.org
Date
2014-04-22 09:56:24 -0700 (Tue, 22 Apr 2014)

Log 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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (167663 => 167664)


--- trunk/Source/WebCore/ChangeLog	2014-04-22 16:08:18 UTC (rev 167663)
+++ trunk/Source/WebCore/ChangeLog	2014-04-22 16:56:24 UTC (rev 167664)
@@ -1,3 +1,18 @@
+2014-04-22  Commit Queue  <commit-qu...@webkit.org>
+
+        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
+
 2014-04-22  David Hyatt  <hy...@apple.com>
 
         [New Multicolumn] fast/multicol/multicol-with-child-renderLayer-for-input.html puts the textfield in the wrong place

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (167663 => 167664)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2014-04-22 16:08:18 UTC (rev 167663)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2014-04-22 16:56:24 UTC (rev 167664)
@@ -320,7 +320,6 @@
     FloatSize m_cachedPresentationSize;
     double m_cachedDuration;
     double m_cachedRate;
-    mutable long long m_cachedTotalBytes;
     unsigned m_pendingStatusChanges;
     int m_cachedItemStatus;
     bool m_cachedLikelyToKeepUp;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (167663 => 167664)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-04-22 16:08:18 UTC (rev 167663)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-04-22 16:56:24 UTC (rev 167664)
@@ -294,7 +294,6 @@
 
 static NSArray *assetMetadataKeyNames();
 static NSArray *itemKVOProperties();
-static NSArray* assetTrackMetadataKeyNames();
 
 #if !LOG_DISABLED
 static const char *boolString(bool val)
@@ -366,7 +365,6 @@
     , m_currentTextTrack(0)
     , m_cachedDuration(MediaPlayer::invalidTime())
     , m_cachedRate(0)
-    , m_cachedTotalBytes(0)
     , m_pendingStatusChanges(0)
     , m_cachedItemStatus(MediaPlayerAVPlayerItemStatusDoesNotExist)
     , m_cachedLikelyToKeepUp(false)
@@ -785,23 +783,9 @@
 void MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata()
 {
     LOG(Media, "MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata(%p) - requesting metadata loading", this);
-    dispatch_group_t metadataLoadingGroup = dispatch_group_create();
-    dispatch_group_enter(metadataLoadingGroup);
     [m_avAsset.get() loadValuesAsynchronouslyForKeys:[assetMetadataKeyNames() retain] completionHandler:^{
-        if ([m_avAsset.get() statusOfValueForKey:@"tracks" error:nil] == AVKeyValueStatusLoaded) {
-            for (AVAssetTrack *track in [m_avAsset.get() tracks]) {
-                dispatch_group_enter(metadataLoadingGroup);
-                [track loadValuesAsynchronouslyForKeys:[assetTrackMetadataKeyNames() retain] completionHandler:^{
-                    dispatch_group_leave(metadataLoadingGroup);
-                }];
-            }
-        }
-        dispatch_group_leave(metadataLoadingGroup);
-    }];
-    dispatch_group_notify(metadataLoadingGroup, dispatch_get_main_queue(), ^{
         [m_objcObserver.get() metadataLoaded];
-    });
-    dispatch_release(metadataLoadingGroup);
+    }];
 }
 
 MediaPlayerPrivateAVFoundation::ItemStatus MediaPlayerPrivateAVFoundationObjC::playerItemStatus() const
@@ -1146,13 +1130,11 @@
     if (!metaDataAvailable())
         return 0;
 
-    if (m_cachedTotalBytes)
-        return m_cachedTotalBytes;
-
+    long long totalMediaSize = 0;
     for (AVPlayerItemTrack *thisTrack in m_cachedTracks.get())
-        m_cachedTotalBytes += [[thisTrack assetTrack] totalSampleDataLength];
+        totalMediaSize += [[thisTrack assetTrack] totalSampleDataLength];
 
-    return m_cachedTotalBytes;
+    return totalMediaSize;
 }
 
 void MediaPlayerPrivateAVFoundationObjC::setAsset(id asset)
@@ -2361,7 +2343,6 @@
 void MediaPlayerPrivateAVFoundationObjC::tracksDidChange(RetainPtr<NSArray> tracks)
 {
     m_cachedTracks = tracks;
-    m_cachedTotalBytes = 0;
 
     tracksChanged();
     updateStates();
@@ -2443,15 +2424,6 @@
     return keys;
 }
 
-NSArray* assetTrackMetadataKeyNames()
-{
-    static NSArray* keys;
-    if (!keys)
-        keys = @[@"totalSampleDataLength", @"mediaType"];
-
-    return keys;
-}
-
 } // namespace WebCore
 
 @implementation WebCoreAVFMovieObserver
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to