Add descriptive error message for looper mismatch in BaseMediaSource#3188
Open
NoNews wants to merge 1 commit intoandroidx:mainfrom
Open
Add descriptive error message for looper mismatch in BaseMediaSource#3188NoNews wants to merge 1 commit intoandroidx:mainfrom
NoNews wants to merge 1 commit intoandroidx:mainfrom
Conversation
The checkArgument in prepareSource() previously threw an IllegalArgumentException with no message when a MediaSource was prepared on a different looper than the one it was originally bound to. This exception is caught and mapped to ERROR_CODE_FAILED_RUNTIME_CHECK (1004) with no further context, making the root cause very hard to diagnose. Add a message that names both loopers and points to ExoPlayer.Builder.setPlaybackLooper() as the recommended fix. Made-with: Cursor
Collaborator
|
Did the stack trace you had not point to the line of the I think in general we write exception checks & messages on the assumption that the reader will cross-reference with the relevant source code for additional context. This is partly to keep APK bloat in check by avoiding long strings on every edge-case exception check. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reusing a cached
MediaSourceacross players with different playback threads throws a message-lessIllegalArgumentException, silently swallowed into error code 1004.Impact at Reddit Android App
We experienced ~2M errors/day. It only showed up in one specific edge case, so we had nothing to go on but telemetry with 1004 error code — and the empty exception made it much harder to pin down. (We spent a week debugging this).
We're currently experimenting with a single shared looper and seeing the problem addressed.
See #2263
Thank you!