mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-03 12:23:27 +02:00
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>
This commit is contained in:
parent
eb22c222a0
commit
b258e85f69
|
@ -187,7 +187,8 @@ public class UniversalAudioController : BaseJellyfinApiController
|
||||||
var supportedHlsContainers = new[] { "ts", "mp4" };
|
var supportedHlsContainers = new[] { "ts", "mp4" };
|
||||||
|
|
||||||
// fallback to mpegts if device reports some weird value unsupported by hls
|
// fallback to mpegts if device reports some weird value unsupported by hls
|
||||||
var segmentContainer = Array.Exists(supportedHlsContainers, element => element == transcodingContainer) ? transcodingContainer : "ts";
|
var requestedSegmentContainer = Array.Exists(supportedHlsContainers, element => element == transcodingContainer) ? transcodingContainer : "ts";
|
||||||
|
var segmentContainer = Array.Exists(supportedHlsContainers, element => element == mediaSource.TranscodingContainer) ? mediaSource.TranscodingContainer : requestedSegmentContainer;
|
||||||
var dynamicHlsRequestDto = new HlsAudioRequestDto
|
var dynamicHlsRequestDto = new HlsAudioRequestDto
|
||||||
{
|
{
|
||||||
Id = itemId,
|
Id = itemId,
|
||||||
|
|
|
@ -127,6 +127,10 @@ namespace MediaBrowser.Model.Dlna
|
||||||
if (directPlayMethod is PlayMethod.DirectStream)
|
if (directPlayMethod is PlayMethod.DirectStream)
|
||||||
{
|
{
|
||||||
var remuxContainer = item.TranscodingContainer ?? "ts";
|
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;
|
bool codeIsSupported;
|
||||||
if (item.TranscodingSubProtocol == MediaStreamProtocol.hls)
|
if (item.TranscodingSubProtocol == MediaStreamProtocol.hls)
|
||||||
{
|
{
|
||||||
|
@ -152,6 +156,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
playlistItem.Container = remuxContainer;
|
playlistItem.Container = remuxContainer;
|
||||||
playlistItem.TranscodeReasons = transcodeReasons;
|
playlistItem.TranscodeReasons = transcodeReasons;
|
||||||
playlistItem.SubProtocol = item.TranscodingSubProtocol;
|
playlistItem.SubProtocol = item.TranscodingSubProtocol;
|
||||||
|
item.TranscodingContainer = remuxContainer;
|
||||||
return playlistItem;
|
return playlistItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue