aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-03-02 12:09:44 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-03-02 12:09:44 -0500
commit043bef0a51ad8818097280c72f6625c29e680088 (patch)
treeae73f67a89a1217dcf617b2b6a3be2ad1c72b93a
parent771294e756908b2a20d9c6ac85c9c9e5b0f90637 (diff)
parent9cf02c18d520e7786647c8e7f44a7d20a2e1eb69 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 5b3221078..c6bcbded8 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -491,6 +491,16 @@ namespace MediaBrowser.Api.Playback
return string.Format("{4} -vf \"{0}scale=trunc({1}/2)*2:trunc({2}/2)*2{3}\"", yadifParam, widthParam, heightParam, assSubtitleParam, copyTsParam);
}
+
+ // If Max dimensions were supplied
+ //this makes my brain hurt. For width selects lowest even number between input width and width req size and selects lowest even number from in width*display aspect and requested size
+ if (request.MaxWidth.HasValue && request.MaxHeight.HasValue)
+ {
+ var MaxwidthParam = request.MaxWidth.Value.ToString(UsCulture);
+ var MaxheightParam = request.MaxHeight.Value.ToString(UsCulture);
+
+ return string.Format("{4} -vf \"{0}scale=trunc(min(iw\\,{1})/2)*2:trunc(min((iw/dar)\\,{2})/2)*2{3}\"", yadifParam, MaxwidthParam, MaxheightParam, assSubtitleParam, copyTsParam);
+ }
var isH264Output = outputVideoCodec.Equals("libx264", StringComparison.OrdinalIgnoreCase);