Title: [178500] branches/safari-600.5-branch/Source/WebCore
Revision
178500
Author
[email protected]
Date
2015-01-15 02:27:50 -0800 (Thu, 15 Jan 2015)

Log Message

Merged r176879. rdar://problems/19424174

Modified Paths

Diff

Modified: branches/safari-600.5-branch/Source/WebCore/ChangeLog (178499 => 178500)


--- branches/safari-600.5-branch/Source/WebCore/ChangeLog	2015-01-15 10:27:42 UTC (rev 178499)
+++ branches/safari-600.5-branch/Source/WebCore/ChangeLog	2015-01-15 10:27:50 UTC (rev 178500)
@@ -1,5 +1,22 @@
 2015-01-15  Matthew Hanson  <[email protected]>
 
+        Merge r176879. rdar://problem/19424174
+
+    2014-12-05  Jer Noble  <[email protected]>
+
+            [MSE][Mac] Return absolute value of error code from CDMSessionMediaSourceAVFObjC::update().
+            https://bugs.webkit.org/show_bug.cgi?id=139316
+
+            Reviewed by Eric Carlson.
+
+            Similarly to our asynchronous error reporting, return the absolute value of the error code.
+
+            * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
+            (WebCore::systemCodeForError):
+            (WebCore::CDMSessionMediaSourceAVFObjC::update):
+
+2015-01-15  Matthew Hanson  <[email protected]>
+
         Merge r176482. rdar://problem/19424172
 
     2014-11-21  Jer Noble  <[email protected]>

Modified: branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm (178499 => 178500)


--- branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm	2015-01-15 10:27:42 UTC (rev 178499)
+++ branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm	2015-01-15 10:27:50 UTC (rev 178500)
@@ -176,6 +176,19 @@
     return !literal[length];
 }
 
+static NSInteger systemCodeForError(NSError *error)
+{
+    NSInteger code = [error code];
+    if (code != AVErrorUnknown)
+        return code;
+
+    NSError* underlyingError = [error valueForKey:NSUnderlyingErrorKey];
+    if (!underlyingError || ![underlyingError isKindOfClass:[NSError class]])
+        return code;
+    
+    return [underlyingError code];
+}
+
 bool CDMSessionMediaSourceAVFObjC::update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, unsigned long& systemCode)
 {
     bool shouldGenerateKeyRequest = !m_certificate || isEqual(key, "renew");
@@ -243,7 +256,7 @@
         if (error) {
             LOG(Media, "CDMSessionMediaSourceAVFObjC::update(%p) - error:%@", this, [error description]);
             errorCode = MediaPlayer::InvalidPlayerState;
-            systemCode = [error code];
+            systemCode = abs(systemCodeForError(error));
             return false;
         }
 
@@ -262,19 +275,6 @@
     return true;
 }
 
-static NSInteger systemCodeForError(NSError *error)
-{
-    NSInteger code = [error code];
-    if (code != AVErrorUnknown)
-        return code;
-
-    NSError* underlyingError = [error valueForKey:NSUnderlyingErrorKey];
-    if (!underlyingError || ![underlyingError isKindOfClass:[NSError class]])
-        return code;
-
-    return [underlyingError code];
-}
-
 void CDMSessionMediaSourceAVFObjC::layerDidReceiveError(AVSampleBufferDisplayLayer *, NSError *error)
 {
     if (!m_client)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to