summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-28 19:36:11 +0200
committerwm4 <wm4@nowhere>2016-03-28 19:36:11 +0200
commitcdd30fd0abaa6e4773032b96568d23440417edb1 (patch)
tree1c845c18499f23cd124c7a0167cbb256d5fce548
parentbd98d9e232242169d594d2a0873f6327ad361463 (diff)
downloadmpv-cdd30fd0abaa6e4773032b96568d23440417edb1.tar.bz2
mpv-cdd30fd0abaa6e4773032b96568d23440417edb1.tar.xz
player: remove auto-inserted filters before adding them again
Makes certain cases of runtime changes actually work. Also change the label for the stereo3d filter and make it consistent with the rotate one.
-rw-r--r--player/video.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c
index 24e01d3c06..c398c05890 100644
--- a/player/video.c
+++ b/player/video.c
@@ -166,6 +166,16 @@ static void filter_reconfig(struct vo_chain *vo_c)
if (vf_reconfig(vo_c->vf, &params) < 0)
return;
+ char *filters[] = {"autorotate", "autostereo3d", NULL};
+ for (int n = 0; filters[n]; n++) {
+ struct vf_instance *vf = vf_find_by_label(vo_c->vf, filters[n]);
+ if (vf) {
+ vf_remove_filter(vo_c->vf, vf);
+ if (vf_reconfig(vo_c->vf, &params) < 0)
+ return;
+ }
+ }
+
if (params.rotate && (params.rotate % 90 == 0)) {
if (!(vo_c->vo->driver->caps & VO_CAP_ROTATE90)) {
// Try to insert a rotation filter.
@@ -184,7 +194,7 @@ static void filter_reconfig(struct vo_chain *vo_c)
char *to = (char *)MP_STEREO3D_NAME(params.stereo_out);
if (to) {
char *args[] = {"in", "auto", "out", to, NULL, NULL};
- if (try_filter(vo_c, params, "stereo3d", "stereo3d", args) < 0)
+ if (try_filter(vo_c, params, "stereo3d", "autostereo3d", args) < 0)
MP_ERR(vo_c, "Can't insert 3D conversion filter.\n");
}
}