Don't check offload support for formats without defined sample rate.
Otherwise the Builder of AudioFormat will throw because we pass in an invalid value. #minor-release PiperOrigin-RevId: 535169406
This commit is contained in:
parent
2c07468908
commit
418b2a5f1b
@ -71,7 +71,7 @@ public final class DefaultAudioOffloadSupportProvider
|
|||||||
checkNotNull(format);
|
checkNotNull(format);
|
||||||
checkNotNull(audioAttributes);
|
checkNotNull(audioAttributes);
|
||||||
|
|
||||||
if (Util.SDK_INT < 29) {
|
if (Util.SDK_INT < 29 || format.sampleRate == Format.NO_VALUE) {
|
||||||
return AudioOffloadSupport.DEFAULT_UNSUPPORTED;
|
return AudioOffloadSupport.DEFAULT_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user