mirror of
https://github.com/mpv-player/mpv
synced 2025-02-18 22:06:59 +00:00
vf: fix unintended overwriting of image info
The symptom was that "-vf scale,format=rgba" broke the vsfilter colorspace hack in sd_ass. vf->reconfig is allowed to overwrite its input parameter for convenience (maybe that was a bad idea).
This commit is contained in:
parent
ca678dce4d
commit
ff0680c9b4
@ -432,7 +432,7 @@ void vf_chain_seek_reset(struct vf_instance *vf)
|
||||
vf_forget_frames(cur);
|
||||
}
|
||||
|
||||
int vf_reconfig_wrapper(struct vf_instance *vf, struct mp_image_params *p,
|
||||
int vf_reconfig_wrapper(struct vf_instance *vf, const struct mp_image_params *p,
|
||||
int flags)
|
||||
{
|
||||
vf_forget_frames(vf);
|
||||
@ -446,7 +446,8 @@ int vf_reconfig_wrapper(struct vf_instance *vf, struct mp_image_params *p,
|
||||
|
||||
int r;
|
||||
if (vf->reconfig) {
|
||||
r = vf->reconfig(vf, p, flags);
|
||||
struct mp_image_params params = *p;
|
||||
r = vf->reconfig(vf, ¶ms, flags);
|
||||
} else {
|
||||
r = vf->config(vf, p->w, p->h, p->d_w, p->d_h, flags, p->imgfmt);
|
||||
r = r ? 0 : -1;
|
||||
|
@ -147,8 +147,8 @@ vf_instance_t *vf_find_by_label(vf_instance_t *chain, const char *label);
|
||||
void vf_uninit_filter(vf_instance_t *vf);
|
||||
void vf_uninit_filter_chain(vf_instance_t *vf);
|
||||
|
||||
int vf_reconfig_wrapper(struct vf_instance *vf, struct mp_image_params *params,
|
||||
int flags);
|
||||
int vf_reconfig_wrapper(struct vf_instance *vf,
|
||||
const struct mp_image_params *params, int flags);
|
||||
void vf_print_filter_chain(int msglevel, struct vf_instance *vf);
|
||||
|
||||
void vf_rescale_dsize(int *d_width, int *d_height, int old_w, int old_h,
|
||||
|
Loading…
Reference in New Issue
Block a user