Skip to content

Commit

Permalink
vf_format: reset crop if user is adjusting frame size
Browse files Browse the repository at this point in the history
The original crop will not be valid anyway.
  • Loading branch information
kasper93 committed Sep 6, 2024
1 parent 10cdc78 commit 2649b83
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions video/filter/vf_format.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@ static void set_params(struct vf_format_opts *p, struct mp_image_params *out,
if (p->alpha)
out->repr.alpha = p->alpha;

if (p->w > 0 && set_size)
if (p->w > 0 && set_size) {
out->w = p->w;
if (p->h > 0 && set_size)
out->crop = (struct mp_rect){0};
}
if (p->h > 0 && set_size) {
out->h = p->h;
out->crop = (struct mp_rect){0};
}
AVRational dsize;
mp_image_params_get_dsize(out, &dsize.num, &dsize.den);
if (p->dw > 0)
Expand Down

0 comments on commit 2649b83

Please sign in to comment.