Refactor AudioCapabilities.getCapabilities

This commit is contained in:
Tianyi Feng 2023-05-16 11:07:52 +00:00
parent c61f8d317a
commit b9a53da121

View File

@ -124,12 +124,11 @@ public final class AudioCapabilities {
} }
ImmutableSet supportedEncodingsSet = supportedEncodings.build(); ImmutableSet supportedEncodingsSet = supportedEncodings.build();
if (supportedEncodingsSet.isEmpty()) { if (!supportedEncodingsSet.isEmpty()) {
return DEFAULT_AUDIO_CAPABILITIES;
} else {
return new AudioCapabilities( return new AudioCapabilities(
Ints.toArray(supportedEncodingsSet), /* defaultValue= */ DEFAULT_MAX_CHANNEL_COUNT); Ints.toArray(supportedEncodingsSet), /* defaultValue= */ DEFAULT_MAX_CHANNEL_COUNT);
} }
return DEFAULT_AUDIO_CAPABILITIES;
} }
/** /**