[EME][Mac] Crash in [AVStreamSession addStreamDataParser:]; uncaught exception
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jan 2016 20:45:58 +0000 (20:45 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jan 2016 20:45:58 +0000 (20:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=153495

Reviewed by Eric Carlson.

When AVContentKeySession is not available, fall back to pre-AVContentKeySession behavior;
namely, immediately create an AVStreamSession object in
willProvideContentKeyRequestInitializationData, rather than waiting for didProvide.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195609 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm

index 2aa03a6..5d17994 100644 (file)
@@ -1,3 +1,17 @@
+2016-01-26  Jeremy Noble  <jer.noble@apple.com>
+
+        [EME][Mac] Crash in [AVStreamSession addStreamDataParser:]; uncaught exception
+        https://bugs.webkit.org/show_bug.cgi?id=153495
+
+        Reviewed by Eric Carlson.
+
+        When AVContentKeySession is not available, fall back to pre-AVContentKeySession behavior;
+        namely, immediately create an AVStreamSession object in
+        willProvideContentKeyRequestInitializationData, rather than waiting for didProvide.
+
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
+
 2016-01-26  Dean Jackson  <dino@apple.com>
 
         [iOS] Documents without an explicit width should not get fast tapping
index e5df75f..e8aec31 100644 (file)
@@ -29,6 +29,7 @@
 #if ENABLE(MEDIA_SOURCE) && USE(AVFOUNDATION)
 
 #import "BlockExceptions.h"
+#import "CDMSessionAVContentKeySession.h"
 #import "CDMSessionMediaSourceAVFObjC.h"
 #import "ExceptionCodePlaceholder.h"
 #import "Logging.h"
@@ -721,6 +722,11 @@ void SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataF
 
     if (CDMSessionMediaSourceAVFObjC* session = m_mediaSource->player()->cdmSession())
         session->addParser(m_parser.get());
+    else if (!CDMSessionAVContentKeySession::isAvailable()) {
+        BEGIN_BLOCK_OBJC_EXCEPTIONS;
+        [m_mediaSource->player()->streamSession() addStreamDataParser:m_parser.get()];
+        END_BLOCK_OBJC_EXCEPTIONS;
+    }
 #else
     UNUSED_PARAM(trackID);
 #endif