Skip to content

c2.sec.flac.decoder does not support 32-bit audio on Android 14 #2570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -382,14 +382,23 @@ private boolean isCodecProfileAndLevelSupported(
}

private boolean isCompressedAudioBitDepthSupported(Format format) {
// MediaCodec doesn't have a way to query FLAC decoder bit-depth support.
// c2.android.flac.decoder is known not to support 32-bit until API 34. We optimistically assume
// that another (unrecognized) FLAC decoder does support 32-bit on all API levels where it
// exists.
return !Objects.equals(format.sampleMimeType, MimeTypes.AUDIO_FLAC)
|| format.pcmEncoding != C.ENCODING_PCM_32BIT
|| SDK_INT >= 34
|| !name.equals("c2.android.flac.decoder");
// MediaCodec doesn't have a way to query decoder bit-depth support.
if (!Objects.equals(format.sampleMimeType, MimeTypes.AUDIO_FLAC)
|| format.pcmEncoding != C.ENCODING_PCM_32BIT) {
// Only 32-bit FLAC is a concern at the moment, everything else can be marked supported.
return true;
}
// c2.android.flac.decoder is known not to support 32-bit until API 34.
if (name.equals("c2.android.flac.decoder")) {
return SDK_INT >= 34;
}
// c2.sec.flac.decoder is known not to support 32-bit until API 35.
if (name.equals("c2.sec.flac.decoder")) {
return SDK_INT >= 35;
}
// We optimistically assume that another (unrecognized) FLAC decoder does support 32-bit on all
// API levels where it exists.
return true;
}

/** Whether the codec handles HDR10+ out-of-band metadata. */
Expand Down