Title: [200432] trunk/Source/WebCore
Revision
200432
Author
[email protected]
Date
2016-05-04 15:03:45 -0700 (Wed, 04 May 2016)

Log Message

Don't disconnect WebAVPlayerController from its delegate since there is no way to reconnect it.
https://bugs.webkit.org/show_bug.cgi?id=157337

Patch by Jeremy Jones <[email protected]> on 2016-05-04
Reviewed by Jer Noble.

WebAVPlayerController used to be deleted and recreated each time we begin fullscreen video mode.
Since it is now preserved, we shouldn't paritally tear it down in cleanupFullscreen by disconnecting it
from its delegate, especially since we have no way to reconnect it.

The side effect of leaving it connected is that it can continue to make callbacks during cleanup.
Of importance is that it sets the audio and legible media selctions to nil. We don't want to change
the selection as a result of teardown. Nil selection is unsupported by WebVideoFullscreenModelVideoElement
and causes an assert. This transition to nil selection is now ignored.

* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]):
(-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]):
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (200431 => 200432)


--- trunk/Source/WebCore/ChangeLog	2016-05-04 21:33:45 UTC (rev 200431)
+++ trunk/Source/WebCore/ChangeLog	2016-05-04 22:03:45 UTC (rev 200432)
@@ -1,3 +1,25 @@
+2016-05-04  Jeremy Jones  <[email protected]>
+
+        Don't disconnect WebAVPlayerController from its delegate since there is no way to reconnect it.
+        https://bugs.webkit.org/show_bug.cgi?id=157337
+
+        Reviewed by Jer Noble.
+
+        WebAVPlayerController used to be deleted and recreated each time we begin fullscreen video mode.
+        Since it is now preserved, we shouldn't paritally tear it down in cleanupFullscreen by disconnecting it
+        from its delegate, especially since we have no way to reconnect it.
+
+        The side effect of leaving it connected is that it can continue to make callbacks during cleanup.
+        Of importance is that it sets the audio and legible media selctions to nil. We don't want to change 
+        the selection as a result of teardown. Nil selection is unsupported by WebVideoFullscreenModelVideoElement
+        and causes an assert. This transition to nil selection is now ignored.
+
+        * platform/ios/WebAVPlayerController.mm:
+        (-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]):
+        (-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]):
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
+
 2016-05-04  Chris Dumez  <[email protected]>
 
         Media elements should not be paused right away when removed from the document

Modified: trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm (200431 => 200432)


--- trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm	2016-05-04 21:33:45 UTC (rev 200431)
+++ trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm	2016-05-04 22:03:45 UTC (rev 200432)
@@ -401,7 +401,10 @@
     if (option && self.audioMediaSelectionOptions)
         index = [self.audioMediaSelectionOptions indexOfObject:option];
 
-    self.delegate->selectAudioMediaOption(index != NSNotFound ? index : UINT64_MAX);
+    if (index == NSNotFound)
+        return;
+
+    self.delegate->selectAudioMediaOption(index);
 }
 
 - (WebAVMediaSelectionOption *)currentLegibleMediaSelectionOption
@@ -425,7 +428,10 @@
     if (option && self.legibleMediaSelectionOptions)
         index = [self.legibleMediaSelectionOptions indexOfObject:option];
 
-    self.delegate->selectLegibleMediaOption(index != NSNotFound ? index : UINT64_MAX);
+    if (index == NSNotFound)
+        return;
+
+    self.delegate->selectLegibleMediaOption(index);
 }
 
 - (BOOL)isPlayingOnExternalScreen

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (200431 => 200432)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2016-05-04 21:33:45 UTC (rev 200431)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2016-05-04 22:03:45 UTC (rev 200432)
@@ -815,8 +815,6 @@
             [[getUIApplicationClass() sharedApplication] _setStatusBarOrientation:[m_parentWindow interfaceOrientation]];
     }
     
-    [playerController() setDelegate:nil];
-    
     [m_playerViewController setDelegate:nil];
     [m_playerViewController setPlayerController:nil];
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to