From 3d697cdab27baa33c9d00785fce6de4c448d6028 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 21 Jan 2014 20:37:01 -0500 Subject: added new stream info properties --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 32 ++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs') diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 9c147379a..10ef902d9 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1059,9 +1059,10 @@ namespace MediaBrowser.Api.Playback } //state.RunTimeTicks = recording.RunTimeTicks; - state.SendInputOverStandardInput = recording.RecordingInfo.Status == RecordingStatus.InProgress; + state.ReadInputAtNativeFramerate = recording.RecordingInfo.Status == RecordingStatus.InProgress; state.AudioSync = 1000; state.DeInterlace = true; + state.InputFormat = "mpegts"; } else if (item is LiveTvChannel) { @@ -1087,8 +1088,10 @@ namespace MediaBrowser.Api.Playback } state.SendInputOverStandardInput = true; + state.ReadInputAtNativeFramerate = true; state.AudioSync = 1000; state.DeInterlace = true; + state.InputFormat = "mpegts"; } else { @@ -1140,6 +1143,33 @@ namespace MediaBrowser.Api.Playback return state; } + protected string GetInputModifier(StreamState state) + { + var inputModifier = string.Empty; + + if (!string.IsNullOrEmpty(state.InputFormat)) + { + inputModifier += " -f " + state.InputFormat; + } + + if (!string.IsNullOrEmpty(state.InputVideoCodec)) + { + inputModifier += " -vcodec " + state.InputVideoCodec; + } + + if (!string.IsNullOrEmpty(state.InputAudioCodec)) + { + inputModifier += " -acodec " + state.InputAudioCodec; + } + + if (state.ReadInputAtNativeFramerate) + { + inputModifier += " -re"; + } + + return inputModifier; + } + /// /// Infers the audio codec based on the url /// -- cgit v1.2.3