1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 14:52:43 +00:00

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

View File

@ -1141,6 +1141,11 @@ struct AVFrame *mp_image_to_av_frame(struct mp_image *src)
dst->width = src->w;
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.den = src->params.p_h;