diff options
| author | gnattu <gnattuoc@me.com> | 2024-04-22 22:31:41 +0800 |
|---|---|---|
| committer | gnattu <gnattuoc@me.com> | 2024-07-17 13:35:59 +0800 |
| commit | a16d3d488704be5a2e8b528c446f06588831246d (patch) | |
| tree | dc92c8a5956cc9273bdaaf7a67bb34ca2593bf3c /MediaBrowser.Model/Dlna | |
| parent | e4101128e011c089bad46a524856438154cfbd3d (diff) | |
Allow clients to send audio container override for HLS
This will improve flexibility due to overcome the complex compatibility situation of HLS
Signed-off-by: gnattu <gnattuoc@me.com>
Diffstat (limited to 'MediaBrowser.Model/Dlna')
| -rw-r--r-- | MediaBrowser.Model/Dlna/StreamBuilder.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index f9fe7d351..20d9cd8d5 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -127,6 +127,10 @@ namespace MediaBrowser.Model.Dlna if (directPlayMethod is PlayMethod.DirectStream) { var remuxContainer = item.TranscodingContainer ?? "ts"; + var supportedHlsContainers = new[] { "ts", "mp4" }; + // If the container specified for the profile is an HLS supported container, use that container instead, overriding the preference + // The client should be responsible to ensure this container is compatible + remuxContainer = Array.Exists(supportedHlsContainers, element => element == directPlayInfo.Profile?.Container) ? directPlayInfo.Profile?.Container : remuxContainer; bool codeIsSupported; if (item.TranscodingSubProtocol == MediaStreamProtocol.hls) { @@ -152,6 +156,7 @@ namespace MediaBrowser.Model.Dlna playlistItem.Container = remuxContainer; playlistItem.TranscodeReasons = transcodeReasons; playlistItem.SubProtocol = item.TranscodingSubProtocol; + item.TranscodingContainer = remuxContainer; return playlistItem; } |
