mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #12837] [MERGED] Infer more audio codec from containers #13390
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/12837
Author: @gnattu
Created: 10/17/2024
Status: ✅ Merged
Merged: 10/19/2024
Merged by: @crobibero
Base:
master← Head:infer-more-codec📝 Commits (1)
fa09e07Infer more audio codec from containers📊 Changes
1 file changed (+9 additions, -37 deletions)
View changed files
📝
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs(+9 -37)📄 Description
This is mainly for some broken legacy clients that will unlikely to receive proper fix for audio transcoding profile and migrate to our new universal audio controller anytime soon. These legacy clients used an outdated Emby-era audio transcoding pipeline, where the client neither explicitly specifies the desired transcoding formats nor properly indicates the supported audio codecs in its request. Instead, they rely on just providing a container name in the request URL, hoping the server can guess the correct audio codec. However, this guessing is often inaccurate as the container-to-codec mapping has been hard-coded and outdated for six years. When the server cannot guess it will just return "copy" which will obviously fail because the client is requesting transcoding. This PR makes the infer logic more robust to only infer from containers that does not have the same name as the audio codec, and pick the "should be compatible" codec for the container. This may still fail in edge cases if the client is weird enough, but should cover most use cases.
Please note that some clients (like JMP) always requests the container same as the source audio (like from flac to flac) which might make the transcoding behavior weird, this has to be fixed on the client side.
Changes
Issues
Fixes #12822
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.