Continue playback on another decoder when one fails mid-stream - #3422
Open
HaraldNordgren wants to merge 1 commit into
Open
HaraldNordgren wants to merge 1 commit into
HaraldNordgren wants to merge 1 commit into
Conversation
HaraldNordgren
marked this pull request as ready for review
September 20, 2026 18:10
Author
|
Ping @rohitjoins @tonihei |
Contributor
|
As per repo policy, before we review your CL, would you mind rebasing your CL to the androidx:main branch? |
A decoder can throw well after initializing successfully, for example a device-specific hardware bug on one particular file. That was always fatal before, even with another decoder available. Decoder fallback now covers this case too, so playback continues.
HaraldNordgren
force-pushed
the
fix/recover-from-runtime-decoder-failures
branch
from
September 22, 2026 12:44
ef26100 to
d31544a
Compare
Author
|
@microkatz Done! Maybe it would be good to change the default branch of this repo to |
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.
I ran into a specific HEVC file that would reliably fail on a Philips Android TV: it played fine for the first 48 minutes, then hard failed every single time I tried to resume from that point, at the exact same timestamp. Device logs showed the TV's MediaTek hardware HEVC decoder itself crashing partway through decoding, well after it had already initialized and decoded almost an hour of video successfully. Since decoder fallback (setEnableDecoderFallback) only ever kicks in when a decoder fails to initialize, a crash like this had no recovery path and surfaced as a fatal playback error every time, on that device, for that file.
This extends decoder fallback to also cover a decoder that crashes partway through decoding, not just one that fails to start. When that happens and another decoder is available for the format, it's excluded and a different decoder is selected, the same way initialization failures are already handled. If no other decoder is available, the failure still surfaces as before.
I verified this against the real failure: with this change, the same file that previously failed every time on this device now falls back to a software decoder mid-stream and plays normally, both from the start and when resuming partway through.
Closes #3421