Fix wrong window size when videos are not in 16:9 (#549)

This commit is contained in:
Jethro-Alter
2019-09-23 10:14:57 +02:00
committed by Paddy Xu
parent da02d6d6ee
commit 7505c40342

View File

@@ -78,16 +78,16 @@ namespace QuickLook.Plugin.VideoViewer
context.TitlebarOverlap = true;
if (_mediaInfo == null ||
!string.IsNullOrEmpty(_mediaInfo.Get(StreamKind.General, 0, "VideoCount"))) // video
!string.IsNullOrWhiteSpace(_mediaInfo.Get(StreamKind.General, 0, "VideoCount"))) // video
{
int.TryParse(_mediaInfo?.Get(StreamKind.Audio, 0, "Width"), out var width);
int.TryParse(_mediaInfo?.Get(StreamKind.Audio, 0, "Height"), out var height);
int.TryParse(_mediaInfo?.Get(StreamKind.Video, 0, "Width"), out var width);
int.TryParse(_mediaInfo?.Get(StreamKind.Video, 0, "Height"), out var height);
double.TryParse(_mediaInfo?.Get(StreamKind.Video, 0, "Rotation"), out var rotation);
var windowSize = new Size
{
Width = Math.Max(1366, width == 0 ? 1366 : width),
Height = Math.Max(768, height == 0 ? 768 : height)
Width = Math.Max(100, width == 0 ? 1366 : width),
Height = Math.Max(100, height == 0 ? 768 : height)
};
if (rotation % 180 != 0)