diff options
author | Tima Vaisburd <timav@chromium.org> | 2016-01-04 16:04:54 -0800 |
---|---|---|
committer | Tima Vaisburd <timav@chromium.org> | 2016-01-05 00:09:59 +0000 |
commit | 7e60c1d778317d31d8465dedb94e4220fc57b8aa (patch) | |
tree | 97af7ebce5ec4330fbdd997e313e11acf5c7c3bb | |
parent | 4e0a4f9f9197fb2424047220554159d9cb857cbb (diff) | |
download | chromium_src-7e60c1d778317d31d8465dedb94e4220fc57b8aa.zip chromium_src-7e60c1d778317d31d8465dedb94e4220fc57b8aa.tar.gz chromium_src-7e60c1d778317d31d8465dedb94e4220fc57b8aa.tar.bz2 |
Merged: Catch all possible exceptions from MediaCodec.configure()
On some devices IllegalArgumentException propagates to the upper
level and causes a crash. With this change we catch every exception,
this results in the player going to the error state.
BUG=569845
TBR=timav
> Review URL: https://codereview.chromium.org/1547773002
> Cr-Commit-Position: refs/heads/master@{#367406}
Review URL: https://codereview.chromium.org/1560563002 .
Cr-Commit-Position: refs/branch-heads/2564@{#462}
Cr-Branched-From: 1283eca15bd9f772387f75241576cde7bdec7f54-refs/heads/master@{#359700}
-rw-r--r-- | media/base/android/java/src/org/chromium/media/MediaCodecBridge.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java index 72c3964..37c2ae1 100644 --- a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java +++ b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java @@ -612,8 +612,14 @@ class MediaCodecBridge { } mMediaCodec.configure(format, surface, crypto, flags); return true; + } catch (IllegalArgumentException e) { + Log.e(TAG, "Cannot configure the video codec, wrong format or surface", e); } catch (IllegalStateException e) { Log.e(TAG, "Cannot configure the video codec", e); + } catch (MediaCodec.CryptoException e) { + Log.e(TAG, "Cannot configure the video codec: DRM error", e); + } catch (Exception e) { + Log.e(TAG, "Cannot configure the video codec", e); } return false; } @@ -716,8 +722,14 @@ class MediaCodecBridge { } } return true; + } catch (IllegalArgumentException e) { + Log.e(TAG, "Cannot configure the audio codec", e); } catch (IllegalStateException e) { Log.e(TAG, "Cannot configure the audio codec", e); + } catch (MediaCodec.CryptoException e) { + Log.e(TAG, "Cannot configure the audio codec: DRM error", e); + } catch (Exception e) { + Log.e(TAG, "Cannot configure the audio codec", e); } return false; } |