aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/BaseStreamingService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 1772cc547..6491b2527 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -282,6 +282,14 @@ namespace MediaBrowser.Api.Playback
string.Format(" -vf \"scale={0}:-1{1}\"", request.Width.Value, assSubtitleParam);
}
+ // If a fixed height was requested
+ if (request.Height.HasValue)
+ {
+ return isH264Output ?
+ string.Format(" -vf \"scale={0}:trunc(oh/a/2)*2{1}\"", request.Height.Value, assSubtitleParam) :
+ string.Format(" -vf \"scale=-1{1}:{0}\"", request.Height.Value, assSubtitleParam);
+ }
+
// If a max width was requested
if (request.MaxWidth.HasValue && (!request.MaxHeight.HasValue || state.VideoStream == null))
{
@@ -290,6 +298,14 @@ namespace MediaBrowser.Api.Playback
string.Format(" -vf \"scale=min(iw\\,{0}):-1{1}\"", request.MaxWidth.Value, assSubtitleParam);
}
+ // If a max height was requested
+ if (request.MaxHeight.HasValue && (!request.MaxWidth.HasValue || state.VideoStream == null))
+ {
+ return isH264Output ?
+ string.Format(" -vf \"scale=min(ih\\,{0}):trunc(oh/a/2)*2{1}\"", request.MaxHeight.Value, assSubtitleParam) :
+ string.Format(" -vf \"scale=min(ih\\,{0}):-1{1}\"", request.MaxHeight.Value, assSubtitleParam);
+ }
+
if (state.VideoStream == null)
{
// No way to figure this out