⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 176482 in webkit


Ignore:
Timestamp:
Nov 21, 2014, 4:04:58 PM (12 years ago)
Author:
jer.noble@apple.com
Message:

[EME][Mac] Check the underlying error if the one returned by AVFoundation is AVErrorUnknown.
https://bugs.webkit.org/show_bug.cgi?id=138986

Reviewed by Eric Carlson.

When we recieve an error with the code AVErrorUnknown, look for an underlying error from CoreMedia (or another
lower-level framework) with a (presumably) more informative error code, and return that code instead.

  • platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:

(WebCore::systemCodeForError):
(WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
(WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r176481 r176482  
     12014-11-21  Jer Noble  <jer.noble@apple.com>
     2
     3        [EME][Mac] Check the underlying error if the one returned by AVFoundation is AVErrorUnknown.
     4        https://bugs.webkit.org/show_bug.cgi?id=138986
     5
     6        Reviewed by Eric Carlson.
     7
     8        When we recieve an error with the code AVErrorUnknown, look for an underlying error from CoreMedia (or another
     9        lower-level framework) with a (presumably) more informative error code, and return that code instead.
     10
     11        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
     12        (WebCore::systemCodeForError):
     13        (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
     14        (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):
     15
    1162014-11-21  Chris Fleizach  <cfleizach@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm

    r175828 r176482  
    3737#import "SoftLinking.h"
    3838#import "UUID.h"
     39#import <AVFoundation/AVError.h>
    3940#import <CoreMedia/CMBase.h>
    4041#import <cstdlib>
     
    263264}
    264265
     266static NSInteger systemCodeForError(NSError *error)
     267{
     268    NSInteger code = [error code];
     269    if (code != AVErrorUnknown)
     270        return code;
     271
     272    NSError* underlyingError = [error valueForKey:NSUnderlyingErrorKey];
     273    if (!underlyingError || ![underlyingError isKindOfClass:[NSError class]])
     274        return code;
     275
     276    return [underlyingError code];
     277}
     278
    265279void CDMSessionMediaSourceAVFObjC::layerDidReceiveError(AVSampleBufferDisplayLayer *, NSError *error)
    266280{
     
    268282        return;
    269283
    270     m_client->sendError(CDMSessionClient::MediaKeyErrorDomain, std::abs([error code]));
     284    m_client->sendError(CDMSessionClient::MediaKeyErrorDomain, std::abs(systemCodeForError(error)));
    271285}
    272286
     
    276290        return;
    277291
    278     m_client->sendError(CDMSessionClient::MediaKeyErrorDomain, std::abs([error code]));
     292    m_client->sendError(CDMSessionClient::MediaKeyErrorDomain, std::abs(systemCodeForError(error)));
    279293}
    280294
Note: See TracChangeset for help on using the changeset viewer.