Merge pull request #2216 from gnattu/master
Let HLS fallback to mpegts in case device reports unsupported container
This commit is contained in:
commit
ce7744806c
|
@ -298,6 +298,10 @@ namespace MediaBrowser.Api.Playback
|
||||||
|
|
||||||
var transcodingProfile = deviceProfile.TranscodingProfiles[0];
|
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
|
var newRequest = new GetMasterHlsAudioPlaylist
|
||||||
{
|
{
|
||||||
AudioBitRate = isStatic ? (int?)null : Convert.ToInt32(Math.Min(request.MaxStreamingBitrate ?? 192000, int.MaxValue)),
|
AudioBitRate = isStatic ? (int?)null : Convert.ToInt32(Math.Min(request.MaxStreamingBitrate ?? 192000, int.MaxValue)),
|
||||||
|
@ -310,7 +314,8 @@ namespace MediaBrowser.Api.Playback
|
||||||
PlaySessionId = playbackInfoResult.PlaySessionId,
|
PlaySessionId = playbackInfoResult.PlaySessionId,
|
||||||
StartTimeTicks = request.StartTimeTicks,
|
StartTimeTicks = request.StartTimeTicks,
|
||||||
Static = isStatic,
|
Static = isStatic,
|
||||||
SegmentContainer = request.TranscodingContainer,
|
// 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,
|
AudioSampleRate = request.MaxAudioSampleRate,
|
||||||
MaxAudioBitDepth = request.MaxAudioBitDepth,
|
MaxAudioBitDepth = request.MaxAudioBitDepth,
|
||||||
BreakOnNonKeyFrames = transcodingProfile.BreakOnNonKeyFrames,
|
BreakOnNonKeyFrames = transcodingProfile.BreakOnNonKeyFrames,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user