mp_image: set crop metadata when converting to AVFrame

So it is not lost after filtering.
This commit is contained in:
Kacper Michajłow 2023-10-20 04:53:15 +02:00 committed by Dudemanguy
parent f8db02b59d
commit 9a7291d48e
1 changed files with 5 additions and 0 deletions

View File

@ -1141,6 +1141,11 @@ struct AVFrame *mp_image_to_av_frame(struct mp_image *src)
dst->width = src->w; dst->width = src->w;
dst->height = src->h; dst->height = src->h;
dst->crop_left = src->params.crop.x0;
dst->crop_top = src->params.crop.y0;
dst->crop_right = dst->width - src->params.crop.x1;
dst->crop_bottom = dst->height - src->params.crop.y1;
dst->sample_aspect_ratio.num = src->params.p_w; dst->sample_aspect_ratio.num = src->params.p_w;
dst->sample_aspect_ratio.den = src->params.p_h; dst->sample_aspect_ratio.den = src->params.p_h;