mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Do not change audio capabilities for error recovery without context
If the deprecated path without a context is used, the capabilities are set externally and can't recover automatically back to the real capabilities. Issue: androidx/media#2168 PiperOrigin-RevId: 730427339
This commit is contained in:
parent
c90ca4e86e
commit
5610cc8465
@ -1275,8 +1275,9 @@ public final class DefaultAudioSink implements AudioSink {
|
||||
if (listener != null) {
|
||||
listener.onAudioSinkError(e);
|
||||
}
|
||||
if (e.isRecoverable) {
|
||||
if (e.isRecoverable && context != null) {
|
||||
// Change to the audio capabilities supported by all the devices during the error recovery.
|
||||
// Only do this if we have a context and the capabilities can automatically adjust back.
|
||||
audioCapabilities = DEFAULT_AUDIO_CAPABILITIES;
|
||||
throw e; // Do not delay the exception if it can be recovered at higher level.
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user