diff options
| author | gnattu <gnattuoc@me.com> | 2019-12-31 22:33:14 -0500 |
|---|---|---|
| committer | gnattu <gnattuoc@me.com> | 2019-12-31 22:33:14 -0500 |
| commit | 167549f5f1563c5d7bcb4808b08231be0f924528 (patch) | |
| tree | 08a83a0f444f597c14aa353a698d059277b53150 | |
| parent | e476125cf8fdfb483920a4a206275470562f187d (diff) | |
Let HLS fallback to mpegts in case device reported unsupported container
| -rw-r--r-- | MediaBrowser.Api/Playback/UniversalAudioService.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Playback/UniversalAudioService.cs b/MediaBrowser.Api/Playback/UniversalAudioService.cs index 9cba9df139..563e09ae69 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, |
