google / google/ExoPlayer

Wrap ParsableByteArray's ISE in ParserExceptions when the error comes from the input media

Open
#9,729 2 comments 0 reactions 1 assignee Claimed by @andrewlewis View on GitHub
enhancement low priority
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

### [REQUIRED] Use case description
We run our app on a custom device, that seems to be affected by a weird issue which rarely corrupts files on the disk. When trying to play such videos using exo it may fail with various exceptions. Before we find (and fix, if possible) a root cause of this issue in aosp or app, we trying to detect and mitigate this.
Since 2.15.0 exoplayer started throwing ParserException instead of IllegalStateException in multiple places (e.g. in [AtomParsers ](https://github.com/google/ExoPlayer/commit/1fa61feb7eb2c33027296511f6ce2a4ae304a814#diff-c4f8a7953ee8a7eb6b5c11b5d978b31fe3ab2008951f581840da58f33aaeb33f)) which simplified it a lot for us, but there is also instance of [IllegalStateException](https://github.com/google/ExoPlayer/blob/release-v2/library/common/src/main/java/com/google/android/exoplayer2/util/ParsableByteArray.java#L371) coming from ParsableByteArray that also indicates that it's parser exception. So it would be great if it will throw specific ParserException instead of IllegalStateException

### Proposed solution
Throw ParserException from ParsableByteArray

Thanks in advance!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.