diff options
| author | hatharry <hatharry@hotmail.com> | 2016-07-25 23:29:52 +1200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-25 23:29:52 +1200 |
| commit | f21f9923de6291aaf985f32dbbbaddbb26d07fb1 (patch) | |
| tree | 1a313e9a1c6790a755926bcef221c5f680537eae /MediaBrowser.Api/Playback/StreamState.cs | |
| parent | 6332d0b9436c511a59e2abd67ea8c24ce3d82ace (diff) | |
| parent | 8328f39834f042e1808fd8506bbc7c48151703ab (diff) | |
Merge pull request #15 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Api/Playback/StreamState.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/StreamState.cs | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index f1f6bb71f..da6be97b6 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -69,7 +69,29 @@ namespace MediaBrowser.Api.Playback public List<string> PlayableStreamFileNames { get; set; } - public int SegmentLength = 3; + public int SegmentLength + { + get + { + if (string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase)) + { + var userAgent = UserAgent ?? string.Empty; + if (userAgent.IndexOf("AppleTV", StringComparison.OrdinalIgnoreCase) != -1) + { + return 10; + } + if (userAgent.IndexOf("cfnetwork", StringComparison.OrdinalIgnoreCase) != -1) + { + return 10; + } + + return 6; + } + + return 3; + } + } + public int HlsListSize { get @@ -84,9 +106,10 @@ namespace MediaBrowser.Api.Playback public long? InputFileSize { get; set; } public string OutputAudioSync = "1"; - public string OutputVideoSync = "vfr"; + public string OutputVideoSync = "-1"; public List<string> SupportedAudioCodecs { get; set; } + public string UserAgent { get; set; } public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger) { @@ -480,18 +503,5 @@ namespace MediaBrowser.Api.Playback return false; } } - - public bool? IsTargetCabac - { - get - { - if (Request.Static) - { - return VideoStream == null ? null : VideoStream.IsCabac; - } - - return true; - } - } } } |
