update live tv hls

This commit is contained in:
Luke Pulverenti 2016-09-20 15:42:53 -04:00
parent bcfef5dd83
commit 97ea2ff43a
3 changed files with 30 additions and 22 deletions

View File

@ -113,6 +113,8 @@ namespace MediaBrowser.Api.Playback.Hls
args += GetGraphicalSubtitleParam(state, codec); args += GetGraphicalSubtitleParam(state, codec);
} }
args += " -flags -global_header";
return args; return args;
} }

View File

@ -1,10 +1,16 @@
using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.LiveTv;
using System; using System;
using System.Collections.Generic;
namespace MediaBrowser.Controller.LiveTv namespace MediaBrowser.Controller.LiveTv
{ {
public class TimerInfo public class TimerInfo
{ {
public TimerInfo()
{
Genres = new List<string>();
}
/// <summary> /// <summary>
/// Id of the recording. /// Id of the recording.
/// </summary> /// </summary>
@ -15,7 +21,7 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary> /// </summary>
/// <value>The series timer identifier.</value> /// <value>The series timer identifier.</value>
public string SeriesTimerId { get; set; } public string SeriesTimerId { get; set; }
/// <summary> /// <summary>
/// ChannelId of the recording. /// ChannelId of the recording.
/// </summary> /// </summary>
@ -26,7 +32,7 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary> /// </summary>
/// <value>The program identifier.</value> /// <value>The program identifier.</value>
public string ProgramId { get; set; } public string ProgramId { get; set; }
/// <summary> /// <summary>
/// Name of the recording. /// Name of the recording.
/// </summary> /// </summary>
@ -76,7 +82,7 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is post padding required; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is post padding required; otherwise, <c>false</c>.</value>
public bool IsPostPaddingRequired { get; set; } public bool IsPostPaddingRequired { get; set; }
/// <summary> /// <summary>
/// Gets or sets the priority. /// Gets or sets the priority.
/// </summary> /// </summary>
@ -98,5 +104,10 @@ namespace MediaBrowser.Controller.LiveTv
public string EpisodeTitle { get; set; } public string EpisodeTitle { get; set; }
public DateTime? OriginalAirDate { get; set; } public DateTime? OriginalAirDate { get; set; }
public bool IsProgramSeries { get; set; } public bool IsProgramSeries { get; set; }
public string HomePageUrl { get; set; }
public float? CommunityRating { get; set; }
public string ShortOverview { get; set; }
public string OfficialRating { get; set; }
public List<string> Genres { get; set; }
} }
} }

View File

@ -609,26 +609,13 @@ namespace MediaBrowser.Model.Dlna
defaultBitrate = StringHelper.EqualsIgnoreCase(targetAudioCodec, "ac3") ? 192000 : 128000; defaultBitrate = StringHelper.EqualsIgnoreCase(targetAudioCodec, "ac3") ? 192000 : 128000;
} }
if (targetAudioChannels.HasValue) if (StringHelper.EqualsIgnoreCase(subProtocol, "hls"))
{ {
if (targetAudioChannels.Value >= 5 && (maxTotalBitrate ?? 0) >= 1200000) defaultBitrate = Math.Min(384000, defaultBitrate);
{ }
if (StringHelper.EqualsIgnoreCase(targetAudioCodec, "ac3")) else
{ {
if (StringHelper.EqualsIgnoreCase(subProtocol, "hls")) defaultBitrate = Math.Min(448000, defaultBitrate);
{
defaultBitrate = Math.Max(384000, defaultBitrate);
}
else
{
defaultBitrate = Math.Max(448000, defaultBitrate);
}
}
else
{
defaultBitrate = Math.Max(320000, defaultBitrate);
}
}
} }
int encoderAudioBitrateLimit = int.MaxValue; int encoderAudioBitrateLimit = int.MaxValue;
@ -647,6 +634,14 @@ namespace MediaBrowser.Model.Dlna
} }
} }
if (maxTotalBitrate.HasValue)
{
if (maxTotalBitrate.Value < 640000)
{
defaultBitrate = Math.Min(128000, defaultBitrate);
}
}
return Math.Min(defaultBitrate, encoderAudioBitrateLimit); return Math.Min(defaultBitrate, encoderAudioBitrateLimit);
} }