diff options
| author | tikuf <admin@nyalindee.com> | 2014-04-09 16:44:07 +1000 |
|---|---|---|
| committer | tikuf <admin@nyalindee.com> | 2014-04-09 16:44:07 +1000 |
| commit | f9eede391b2de2ce80e75d8345aade14f70f1b9d (patch) | |
| tree | 9d7d7c22ebd83062cca6a6e9ef368e5631b7c717 /MediaBrowser.Api/Playback/BaseStreamingService.cs | |
| parent | 89b467ad193a81a5e5cd4b3ad472fc3f2189913c (diff) | |
| parent | d1a9d42eaf486b84e7d77ace69a9607fca76c317 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 612f73191..bb55b893a 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -319,7 +319,7 @@ namespace MediaBrowser.Api.Playback { var param = string.Empty; - var isVc1 = state.VideoStream != null && + var isVc1 = state.VideoStream != null && string.Equals(state.VideoStream.Codec, "vc1", StringComparison.OrdinalIgnoreCase); var qualitySetting = GetQualitySetting(); @@ -438,9 +438,12 @@ namespace MediaBrowser.Api.Playback var channels = GetNumAudioChannelsParam(state.Request, state.AudioStream); // Boost volume to 200% when downsampling from 6ch to 2ch - if (channels.HasValue && channels.Value <= 2 && state.AudioStream.Channels.HasValue && state.AudioStream.Channels.Value > 5) + if (channels.HasValue && channels.Value <= 2) { - volParam = ",volume=2.000000"; + if (state.AudioStream != null && state.AudioStream.Channels.HasValue && state.AudioStream.Channels.Value > 5) + { + volParam = ",volume=2.000000"; + } } if (state.Request.AudioSampleRate.HasValue) @@ -916,7 +919,7 @@ namespace MediaBrowser.Api.Playback var commandLineLogMessage = process.StartInfo.FileName + " " + process.StartInfo.Arguments; Logger.Info(commandLineLogMessage); - var logFilePath = Path.Combine(ServerConfigurationManager.ApplicationPaths.LogDirectoryPath, "ffmpeg-" + Guid.NewGuid() + ".txt"); + var logFilePath = Path.Combine(ServerConfigurationManager.ApplicationPaths.LogDirectoryPath, "transcode-" + Guid.NewGuid() + ".txt"); Directory.CreateDirectory(Path.GetDirectoryName(logFilePath)); // FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory. @@ -1482,17 +1485,14 @@ namespace MediaBrowser.Api.Playback ApplyDeviceProfileSettings(state); - if (videoRequest != null && state.VideoStream != null) + if (videoRequest != null) { - if (CanStreamCopyVideo(videoRequest, state.VideoStream, state.VideoType)) + if (state.VideoStream != null && CanStreamCopyVideo(videoRequest, state.VideoStream, state.VideoType)) { videoRequest.VideoCodec = "copy"; } - } - if (state.AudioStream != null) - { - //if (CanStreamCopyAudio(request, state.AudioStream)) + //if (state.AudioStream != null && CanStreamCopyAudio(request, state.AudioStream)) //{ // request.AudioCodec = "copy"; //} @@ -1625,7 +1625,7 @@ namespace MediaBrowser.Api.Playback return SupportsAutomaticVideoStreamCopy; } - + protected virtual bool SupportsAutomaticVideoStreamCopy { get |
