update hls params

This commit is contained in:
Luke Pulverenti 2017-01-07 03:09:24 -05:00
parent 552e21b864
commit b578877ac4
3 changed files with 14 additions and 11 deletions

View File

@ -309,13 +309,6 @@ namespace MediaBrowser.Api.Playback.Hls
return 0;
}
protected bool IsLiveStream(StreamState state)
{
var isLiveStream = (state.RunTimeTicks ?? 0) == 0;
return isLiveStream;
}
public BaseHlsService(IServerConfigurationManager serverConfig, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IDlnaManager dlnaManager, ISubtitleEncoder subtitleEncoder, IDeviceManager deviceManager, IMediaSourceManager mediaSourceManager, IZipClient zipClient, IJsonSerializer jsonSerializer, IAuthorizationContext authorizationContext) : base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, fileSystem, dlnaManager, subtitleEncoder, deviceManager, mediaSourceManager, zipClient, jsonSerializer, authorizationContext)
{
}

View File

@ -521,7 +521,7 @@ namespace MediaBrowser.Api.Playback.Hls
builder.AppendLine("#EXTM3U");
var isLiveStream = IsLiveStream(state);
var isLiveStream = state.IsSegmentedLiveStream;
var queryStringIndex = Request.RawUrl.IndexOf('?');
var queryString = queryStringIndex == -1 ? string.Empty : Request.RawUrl.Substring(queryStringIndex);

View File

@ -89,17 +89,25 @@ namespace MediaBrowser.Api.Playback
return 10;
}
if (!RunTimeTicks.HasValue)
if (IsSegmentedLiveStream)
{
return 3;
}
return 3;
return 6;
}
return 3;
}
}
public bool IsSegmentedLiveStream
{
get
{
return TranscodingType != TranscodingJobType.Progressive && !RunTimeTicks.HasValue;
}
}
public int HlsListSize
{
get
@ -119,8 +127,9 @@ namespace MediaBrowser.Api.Playback
public List<string> SupportedAudioCodecs { get; set; }
public List<string> SupportedVideoCodecs { get; set; }
public string UserAgent { get; set; }
public TranscodingJobType TranscodingType { get; set; }
public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger)
public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger, TranscodingJobType transcodingType)
{
_mediaSourceManager = mediaSourceManager;
_logger = logger;
@ -128,6 +137,7 @@ namespace MediaBrowser.Api.Playback
SupportedVideoCodecs = new List<string>();
PlayableStreamFileNames = new List<string>();
RemoteHttpHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
TranscodingType = transcodingType;
}
public string InputAudioSync { get; set; }