Title: [217594] trunk/Source/WebCore
Revision
217594
Author
[email protected]
Date
2017-05-31 00:27:38 -0700 (Wed, 31 May 2017)

Log Message

LayoutTest media/video-orientation.html is failing
https://bugs.webkit.org/show_bug.cgi?id=172648
<rdar://problem/31322425>

Reviewed by Eric Carlson.

For videos with rotation tag set, the transform AVAssetTrack.preferredTransform applied to
AVAssetTrack.naturalSize might return a CGSize instance with negative width or height.

Covered by existing tests.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (217593 => 217594)


--- trunk/Source/WebCore/ChangeLog	2017-05-31 07:25:44 UTC (rev 217593)
+++ trunk/Source/WebCore/ChangeLog	2017-05-31 07:27:38 UTC (rev 217594)
@@ -1,3 +1,19 @@
+2017-05-31  Per Arne Vollan  <[email protected]>
+
+        LayoutTest media/video-orientation.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=172648
+        <rdar://problem/31322425>
+
+        Reviewed by Eric Carlson.
+
+        For videos with rotation tag set, the transform AVAssetTrack.preferredTransform applied to
+        AVAssetTrack.naturalSize might return a CGSize instance with negative width or height.
+
+        Covered by existing tests.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
+
 2017-05-30  Frederic Wang  <[email protected]>
 
         Include ScrollingTreeScrollingNode properties in ScrollingTreeFrameScrollingNode::dumpProperties

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


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2017-05-31 07:25:44 UTC (rev 217593)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2017-05-31 07:27:38 UTC (rev 217594)
@@ -1933,8 +1933,14 @@
 #if !HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
         hasCaptions = [[m_avAsset.get() tracksWithMediaType:AVMediaTypeClosedCaption] count];
 #endif
-
-        presentationSizeDidChange(firstEnabledVideoTrack ? FloatSize(CGSizeApplyAffineTransform([firstEnabledVideoTrack naturalSize], [firstEnabledVideoTrack preferredTransform])) : FloatSize());
+        auto size = firstEnabledVideoTrack ? FloatSize(CGSizeApplyAffineTransform([firstEnabledVideoTrack naturalSize], [firstEnabledVideoTrack preferredTransform])) : FloatSize();
+        // For videos with rotation tag set, the transformation above might return a CGSize instance with negative width or height.
+        // See https://bugs.webkit.org/show_bug.cgi?id=172648.
+        if (size.width() < 0)
+            size.setWidth(-size.width());
+        if (size.height() < 0)
+            size.setHeight(-size.height());
+        presentationSizeDidChange(size);
     } else {
         bool hasVideo = false;
         bool hasAudio = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to