summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-28 19:39:33 +0200
committerwm4 <wm4@nowhere>2016-03-28 19:39:33 +0200
commitd73d5327b38f2a5ac46af25a3709fbd50776d5b7 (patch)
tree77e20249f3c2f796a4745f971fad5e70e3b61ca7 /player
parentcdd30fd0abaa6e4773032b96568d23440417edb1 (diff)
downloadmpv-d73d5327b38f2a5ac46af25a3709fbd50776d5b7.tar.bz2
mpv-d73d5327b38f2a5ac46af25a3709fbd50776d5b7.tar.xz
player: fix breakage when combining 3D and rotate auto-filters
This would get stuck in reconfiguring the filter chain forever, because params was mutated ("params.rotate = 0;"). This was used as input for vf_reconfig(), but the filter chain input must always be equivalent to the decoder output, or filter chain reconfiguration will be triggered. The line of code to reset the rotation is from a time when this used to work differently. Also remove the unnecessary try_filter() parameter.
Diffstat (limited to 'player')
-rw-r--r--player/video.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/player/video.c b/player/video.c
index c398c05890..0af0b9065a 100644
--- a/player/video.c
+++ b/player/video.c
@@ -136,8 +136,7 @@ static void set_allowed_vo_formats(struct vo_chain *vo_c)
vo_query_formats(vo_c->vo, vo_c->vf->allowed_output_formats);
}
-static int try_filter(struct vo_chain *vo_c, struct mp_image_params params,
- char *name, char *label, char **args)
+static int try_filter(struct vo_chain *vo_c, char *name, char *label, char **args)
{
struct vf_instance *vf = vf_append_filter(vo_c->vf, name, args);
if (!vf)
@@ -145,10 +144,10 @@ static int try_filter(struct vo_chain *vo_c, struct mp_image_params params,
vf->label = talloc_strdup(vf, label);
- if (vf_reconfig(vo_c->vf, &params) < 0) {
+ if (vf_reconfig(vo_c->vf, &vo_c->input_format) < 0) {
vf_remove_filter(vo_c->vf, vf);
// restore
- vf_reconfig(vo_c->vf, &params);
+ vf_reconfig(vo_c->vf, &vo_c->input_format);
return -1;
}
return 0;
@@ -180,11 +179,8 @@ static void filter_reconfig(struct vo_chain *vo_c)
if (!(vo_c->vo->driver->caps & VO_CAP_ROTATE90)) {
// Try to insert a rotation filter.
char *args[] = {"angle", "auto", NULL};
- if (try_filter(vo_c, params, "rotate", "autorotate", args) >= 0) {
- params.rotate = 0;
- } else {
+ if (try_filter(vo_c, "rotate", "autorotate", args) < 0)
MP_ERR(vo_c, "Can't insert rotation filter.\n");
- }
}
}
@@ -194,7 +190,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", "autostereo3d", args) < 0)
+ if (try_filter(vo_c, "stereo3d", "autostereo3d", args) < 0)
MP_ERR(vo_c, "Can't insert 3D conversion filter.\n");
}
}