mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Refactor video dimension validation in GenerateVideoWithHardSubs
This commit refactors the validation of video dimensions in GenerateVideoWithHardSubs class. Instead of checking width and height separately, a new Dimension object is created and validated with IsValid(). This simplifies the code and improves readability. Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>
This commit is contained in:
parent
93c9e9947a
commit
6323937c30
@ -2202,14 +2202,15 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
vInfo = UiUtil.GetVideoInfo(videoFileName);
|
vInfo = UiUtil.GetVideoInfo(videoFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vInfo.Width == 0 || vInfo.Height == 0)
|
var dimension = new Dimension(vInfo.Height, vInfo.Width);
|
||||||
|
|
||||||
|
// skip audio or damaged files
|
||||||
|
if (!dimension.IsValid())
|
||||||
{
|
{
|
||||||
SeLogger.Error("Skipping burn-in file with no video: " + videoFileName);
|
SeLogger.Error("Skipping burn-in file with no video: " + videoFileName);
|
||||||
// return; // skip audio or damaged files
|
|
||||||
return new Dimension();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Dimension(vInfo.Height, vInfo.Width);
|
return dimension;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
|
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
Loading…
Reference in New Issue
Block a user