From cdd30fd0abaa6e4773032b96568d23440417edb1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 28 Mar 2016 19:36:11 +0200 Subject: 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. --- player/video.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'player/video.c') 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, ¶ms) < 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, ¶ms) < 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"); } } -- cgit v1.2.3