aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/BaseStreamingService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-02-01 15:55:56 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-02-01 15:55:56 -0500
commit30538f0731574428fd785695737a30997eab0ae8 (patch)
tree39add0298ac5e1f89ae1943bf97690df15b8a553 /MediaBrowser.Api/Playback/BaseStreamingService.cs
parent1d849e3f2549b46014e9f8b422399f00fc55add1 (diff)
improve video startup performance
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs29
1 files changed, 18 insertions, 11 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 1cad4a630..bb14bc732 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -2720,6 +2720,15 @@ namespace MediaBrowser.Api.Playback
//inputModifier += " -noaccurate_seek";
}
+ if (!string.IsNullOrWhiteSpace(state.InputContainer))
+ {
+ var inputFormat = GetInputFormat(state.InputContainer);
+ if (!string.IsNullOrWhiteSpace(inputFormat))
+ {
+ inputModifier += " -f " + inputFormat;
+ }
+ }
+
if (state.RunTimeTicks.HasValue)
{
foreach (var stream in state.MediaSource.MediaStreams)
@@ -2738,21 +2747,19 @@ namespace MediaBrowser.Api.Playback
}
}
}
+ }
- //var videoStream = state.VideoStream;
- //if (videoStream != null && !string.IsNullOrWhiteSpace(videoStream.Codec))
- //{
- // inputModifier += " -codec:0 " + videoStream.Codec;
+ return inputModifier;
+ }
- // var audioStream = state.AudioStream;
- // if (audioStream != null && !string.IsNullOrWhiteSpace(audioStream.Codec))
- // {
- // inputModifier += " -codec:1 " + audioStream.Codec;
- // }
- //}
+ private string GetInputFormat(string container)
+ {
+ if (string.Equals(container, "mkv", StringComparison.OrdinalIgnoreCase))
+ {
+ return "matroska";
}
- return inputModifier;
+ return container;
}
private string GetDecoderFromCodec(string codec)