Change image dimentions from double to int

Rename ImageSize -> ImageDimensions
This commit is contained in:
Bond_009
2019-01-26 13:16:47 +01:00
parent d1a0497f55
commit 883575893b
21 changed files with 92 additions and 204 deletions

View File

@@ -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;

View File

@@ -319,7 +319,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
if (VideoStream != null && VideoStream.Width.HasValue && VideoStream.Height.HasValue)
{
var size = new ImageSize
var size = new ImageDimensions
{
Width = VideoStream.Width.Value,
Height = VideoStream.Height.Value
@@ -331,7 +331,7 @@ namespace MediaBrowser.Controller.MediaEncoding
BaseRequest.MaxWidth ?? 0,
BaseRequest.MaxHeight ?? 0);
return Convert.ToInt32(newSize.Width);
return newSize.Width;
}
if (!IsVideoRequest)
@@ -349,7 +349,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
if (VideoStream != null && VideoStream.Width.HasValue && VideoStream.Height.HasValue)
{
var size = new ImageSize
var size = new ImageDimensions
{
Width = VideoStream.Width.Value,
Height = VideoStream.Height.Value
@@ -361,7 +361,7 @@ namespace MediaBrowser.Controller.MediaEncoding
BaseRequest.MaxWidth ?? 0,
BaseRequest.MaxHeight ?? 0);
return Convert.ToInt32(newSize.Height);
return newSize.Height;
}
if (!IsVideoRequest)