diff options
author | wm4 <wm4@nowhere> | 2014-04-21 01:26:56 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-30 11:45:31 +0200 |
commit | da17c64c760be519d48398f6b1425fba556e317e (patch) | |
tree | b0fa6defad1c05acf144e8c5ccb5621647713a05 | |
parent | 57f32f7ca8c3996929fee071159d17bfac656c6c (diff) | |
download | mpv-da17c64c760be519d48398f6b1425fba556e317e.tar.bz2 mpv-da17c64c760be519d48398f6b1425fba556e317e.tar.xz |
vf: remove autoinserted filters on reconfig
When using rotation with hw decoding, and the VO does not support
rotation, vf_rotate is attempted to be inserted. This will go wrong, and
after that it can't recover because a vf_scale filter was autoinserted.
Just removing all autoinserted filters before reconfig fixes this.
-rw-r--r-- | video/filter/vf.c | 7 | ||||
-rw-r--r-- | video/filter/vf.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c index ecfccedbcd..27f2d824a7 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -452,6 +452,7 @@ static void update_formats(struct vf_chain *c, struct vf_instance *vf, MP_INFO(c, "Using conversion filter.\n"); struct vf_instance *conv = vf_open(c, "scale", NULL); if (conv) { + conv->autoinserted = true; conv->next = vf->next; vf->next = conv; update_formats(c, conv, vf->last_outfmts); @@ -505,6 +506,12 @@ int vf_reconfig(struct vf_chain *c, const struct mp_image_params *params) { struct mp_image_params cur = *params; int r = 0; + for (struct vf_instance *vf = c->first; vf; ) { + struct vf_instance *next = vf->next; + if (vf->autoinserted) + vf_remove_filter(c, vf); + vf = next; + } c->first->fmt_in = *params; uint8_t unused[IMGFMT_END - IMGFMT_START]; update_formats(c, c->first, unused); diff --git a/video/filter/vf.h b/video/filter/vf.h index a65492134e..5e20febf60 100644 --- a/video/filter/vf.h +++ b/video/filter/vf.h @@ -75,6 +75,7 @@ typedef struct vf_instance { void (*uninit)(struct vf_instance *vf); char *label; + bool autoinserted; struct mp_image_params fmt_in, fmt_out; |