Skip to main content

## audio_forces_transcode

# Function audio_forces_transcode

Source

    pub fn audio_forces_transcode(streams: &[(Option<&str>, bool)]) -> bool

Expand description

Decide whether we must transcode regardless of what the server negotiated, given the source’s audio streams as `(codec, is_default)` in source order.

Advertising a narrow profile (`video_audio_codecs`) is necessary but not sufficient: Jellyfin 10.11.5 enforces a `DirectPlayProfile`’s container and video codec but ignores its audio codec — an E-AC-3 track is offered for direct play even when the profile lists only AAC, and neither a `VideoAudio` `CodecProfile` nor `MaxAudioChannels` changes that. So the client cannot delegate this decision; it knows what its own renderer can decode and must apply that itself.

The track that matters is the one the server will actually serve (see `served_audio_codec`). An unknown codec is left alone — forcing a transcode on a guess would burn server CPU for files that play.

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