Skip to content

Commit

Permalink
[android] Update MediaCodec exception handling (youtube#919)
Browse files Browse the repository at this point in the history
* [android] Update MediaCodec exception handling

Changes MediaCodecBridge exception handling to be more closely aligned
with Chromium's MediaCodecBridge.

b/285166114
  • Loading branch information
osagie98 committed Jul 18, 2023
1 parent 0a69bb9 commit 3a3f6e2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ private int flush() {
try {
mFlushed = true;
mMediaCodec.flush();
} catch (IllegalStateException e) {
} catch (Exception e) {
Log.e(TAG, "Failed to flush MediaCodec", e);
return MEDIA_CODEC_ERROR;
}
Expand Down Expand Up @@ -1019,6 +1019,9 @@ private int queueSecureInputBuffer(
"Failed to queue secure input buffer, CryptoException with error code "
+ e.getErrorCode());
return MEDIA_CODEC_ERROR;
} catch (IllegalArgumentException e) {
Log.e(TAG, "Failed to queue secure input buffer, IllegalArgumentException " + e);
return MEDIA_CODEC_ERROR;
} catch (IllegalStateException e) {
Log.e(TAG, "Failed to queue secure input buffer, IllegalStateException " + e);
return MEDIA_CODEC_ERROR;
Expand Down

0 comments on commit 3a3f6e2

Please sign in to comment.