Skip to main content

video_audio_codecs

Function video_audio_codecs 

Source
pub fn video_audio_codecs(detected: &str) -> String
Expand description

Narrow a detected audio-codec list to what the renderer that will actually play the video can decode.

The platform list comes from MediaCodecList, which describes ExoPlayer — but the webview <video> element may be what renders the video, and Chromium/WebKit decode a much smaller set than the platform does. Advertising the raw list makes Jellyfin direct-play a track the webview cannot decode, and the user gets picture with no sound.

Which renderer gets it is not fixed: Linux is always the element, and Android follows experimentalNativeVideo, which took ExoPlayer as its default in DR-161 but is a user setting either way. So the narrow list is the only one that holds on both sides of that switch. The cost is a Dolby-licensed Android device transcoding an E-AC-3 track its ExoPlayer could have direct-played; the alternative is silence for everyone the switch lands the other way, which is the bug this exists to prevent.

The gap is widest on devices whose vendor licenses Dolby: a phone with c2.dolby.eac3.decoder reports eac3, so it — and only it — gets a silent direct play where a leaner device is transcoded to AAC and plays fine.

This applies to the video direct-play profile only. Audio-only playback really is ExoPlayer’s, so its profile keeps the full platform list.

TRACES: UR-004 | DR-148 | UT-142