From 167549f5f1563c5d7bcb4808b08231be0f924528 Mon Sep 17 00:00:00 2001 From: gnattu Date: Tue, 31 Dec 2019 22:33:14 -0500 Subject: [PATCH 1/3] Let HLS fallback to mpegts in case device reported unsupported container --- MediaBrowser.Api/Playback/UniversalAudioService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Api/Playback/UniversalAudioService.cs b/MediaBrowser.Api/Playback/UniversalAudioService.cs index 9cba9df13..563e09ae6 100644 --- a/MediaBrowser.Api/Playback/UniversalAudioService.cs +++ b/MediaBrowser.Api/Playback/UniversalAudioService.cs @@ -300,6 +300,9 @@ namespace MediaBrowser.Api.Playback var transcodingProfile = deviceProfile.TranscodingProfiles[0]; + //HLS Segment container can only be mpegts or fmp4 per ffmpeg documentation + var supoortedHLSContainer = new string[] { "mpegts", "fmp4" }; + var newRequest = new GetMasterHlsAudioPlaylist { AudioBitRate = isStatic ? (int?)null : Convert.ToInt32(Math.Min(request.MaxStreamingBitrate ?? 192000, int.MaxValue)), @@ -312,7 +315,8 @@ namespace MediaBrowser.Api.Playback PlaySessionId = playbackInfoResult.PlaySessionId, StartTimeTicks = request.StartTimeTicks, Static = isStatic, - SegmentContainer = request.TranscodingContainer, + //fallback to mpegts if device reports some wierd value that is not supported by HLS + SegmentContainer = Array.Exists(supoortedHLSContainer, element => element == request.TranscodingContainer) ? request.TranscodingContainer : "mpegts", AudioSampleRate = request.MaxAudioSampleRate, MaxAudioBitDepth = request.MaxAudioBitDepth, BreakOnNonKeyFrames = transcodingProfile.BreakOnNonKeyFrames, From d5204f572a1e1c377edfd14e680f438ac104e967 Mon Sep 17 00:00:00 2001 From: gnattu Date: Thu, 9 Jan 2020 02:25:05 -0500 Subject: [PATCH 2/3] Fix typo and plural --- MediaBrowser.Api/Playback/UniversalAudioService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Api/Playback/UniversalAudioService.cs b/MediaBrowser.Api/Playback/UniversalAudioService.cs index 563e09ae6..c9d29f8ef 100644 --- a/MediaBrowser.Api/Playback/UniversalAudioService.cs +++ b/MediaBrowser.Api/Playback/UniversalAudioService.cs @@ -300,8 +300,8 @@ namespace MediaBrowser.Api.Playback var transcodingProfile = deviceProfile.TranscodingProfiles[0]; - //HLS Segment container can only be mpegts or fmp4 per ffmpeg documentation - var supoortedHLSContainer = new string[] { "mpegts", "fmp4" }; + // hls segment container can only be mpegts or fmp4 per ffmpeg documentation + var supportedHLSContainers = new string[] { "mpegts", "fmp4" }; var newRequest = new GetMasterHlsAudioPlaylist { @@ -315,8 +315,8 @@ namespace MediaBrowser.Api.Playback PlaySessionId = playbackInfoResult.PlaySessionId, StartTimeTicks = request.StartTimeTicks, Static = isStatic, - //fallback to mpegts if device reports some wierd value that is not supported by HLS - SegmentContainer = Array.Exists(supoortedHLSContainer, element => element == request.TranscodingContainer) ? request.TranscodingContainer : "mpegts", + // fallback to mpegts if device reports some weird value unsupported by hls + SegmentContainer = Array.Exists(supportedHLSContainers, element => element == request.TranscodingContainer) ? request.TranscodingContainer : "mpegts", AudioSampleRate = request.MaxAudioSampleRate, MaxAudioBitDepth = request.MaxAudioBitDepth, BreakOnNonKeyFrames = transcodingProfile.BreakOnNonKeyFrames, From ea075c1b4805cfabff58739fc4e3de7813a33298 Mon Sep 17 00:00:00 2001 From: gnattu Date: Sun, 12 Jan 2020 13:22:20 -0500 Subject: [PATCH 3/3] Add reminder to remove the workaround This will be no longer needed when ffmpeg is ready Co-Authored-By: dkanada --- MediaBrowser.Api/Playback/UniversalAudioService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/MediaBrowser.Api/Playback/UniversalAudioService.cs b/MediaBrowser.Api/Playback/UniversalAudioService.cs index c9d29f8ef..625ea9ac1 100644 --- a/MediaBrowser.Api/Playback/UniversalAudioService.cs +++ b/MediaBrowser.Api/Playback/UniversalAudioService.cs @@ -301,6 +301,7 @@ namespace MediaBrowser.Api.Playback var transcodingProfile = deviceProfile.TranscodingProfiles[0]; // hls segment container can only be mpegts or fmp4 per ffmpeg documentation + // TODO: remove this when we switch back to the segment muxer var supportedHLSContainers = new string[] { "mpegts", "fmp4" }; var newRequest = new GetMasterHlsAudioPlaylist