Catching OOM errors is bad practise unless there is a specific known
cause that tried to allocate a large amount of memory. Without this
known cause with a large allocation, the source of the error is
likely somewhere else in the app and every random small further
allocation may lead to additional OOM errors (for example b/145134199).
We have three known causes in ExoPlayer:
1. Source allocations based on unexpected values in streams. This is
caught on the loader thread and reported as an
UnexpectedLoaderException.
2. Output buffer allocations by non-MediaCodec decoders. These are
caught in SimpleDecoder on the decoder thread and reported as
UnexpectedDecodeException.
3. Input buffer allocations by non-MediaCodc decoders in their
constructors. These are currently caught on a higher-level and
reported as ExoPlaybackException.TYPE_OUT_OF_MEMORY.
For consistency and to prevent catching OOM errors without known cause
we can remove the generic TYPE_OUT_OF_MEMORY and catch the specific
exception where it occurs to report it as an
ExoPlaybackException.TYPE_RENDERER. This also has the added advantage
that the format metadata is added to the exception.
PiperOrigin-RevId: 351326688
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| audio | Loading commit data... | |
| decoder | Loading commit data... | |
| device | Loading commit data... | |
| drm | Loading commit data... | |
| metadata | Loading commit data... | |
| offline | Loading commit data... | |
| source | Loading commit data... | |
| text | Loading commit data... | |
| trackselection | Loading commit data... | |
| upstream | Loading commit data... | |
| util | Loading commit data... | |
| video | Loading commit data... | |
| C.java | Loading commit data... | |
| ExoPlaybackException.java | Loading commit data... | |
| ExoPlayerLibraryInfo.java | Loading commit data... | |
| Format.java | Loading commit data... | |
| IllegalSeekPositionException.java | Loading commit data... | |
| MediaItem.java | Loading commit data... | |
| MediaMetadata.java | Loading commit data... | |
| ParserException.java | Loading commit data... | |
| PlaybackParameters.java | Loading commit data... | |
| Timeline.java | Loading commit data... | |
| package-info.java | Loading commit data... |