From 883575893b3f4a4224f920e8c143a9edefca13e4 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sat, 26 Jan 2019 13:16:47 +0100 Subject: Change image dimentions from double to int Rename ImageSize -> ImageDimensions --- MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs') diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index e086f9d33..d8d0a1aa3 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -424,11 +424,9 @@ namespace MediaBrowser.Controller.MediaEncoding if (state.VideoStream != null && state.VideoStream.Width.HasValue) { // This is hacky but not sure how to get the exact subtitle resolution - double height = state.VideoStream.Width.Value; - height /= 16; - height *= 9; + int height = Convert.ToInt32((double)state.VideoStream.Width.Value / 16.0 * 9.0); - arg += string.Format(" -canvas_size {0}:{1}", state.VideoStream.Width.Value.ToString(CultureInfo.InvariantCulture), Convert.ToInt32(height).ToString(CultureInfo.InvariantCulture)); + arg += string.Format(" -canvas_size {0}:{1}", state.VideoStream.Width.Value.ToString(CultureInfo.InvariantCulture), height.ToString(CultureInfo.InvariantCulture)); } var subtitlePath = state.SubtitleStream.Path; -- cgit v1.2.3