options: make video-crop validation more strict

This commit is contained in:
Kacper Michajłow
2023-09-18 13:28:59 +02:00
committed by Dudemanguy
parent 582c7556c6
commit 20e584f60b
5 changed files with 14 additions and 14 deletions

View File

@@ -1015,8 +1015,7 @@ static void apply_video_crop(struct MPContext *mpctx, struct vo *vo)
for (int n = 0; n < mpctx->num_next_frames; n++) {
struct m_geometry *gm = &vo->opts->video_crop;
struct mp_image_params p = mpctx->next_frames[n]->params;
if (gm->xy_valid || (gm->wh_valid && (gm->w > 0 || gm->w_per > 0 ||
gm->h > 0 || gm->h_per > 0)))
if (gm->xy_valid || (gm->wh_valid && (gm->w > 0 || gm->h > 0)))
{
m_rect_apply(&p.crop, p.w, p.h, gm);
}