summaryrefslogtreecommitdiffstats
path: root/player/video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-27 18:13:14 +0200
committerwm4 <wm4@nowhere>2014-09-27 18:31:59 +0200
commitcdb25d5a21e2502fef51c2ae7ae387bf990ab73d (patch)
tree612e501e4e087a22722592d921c6966af6b16e33 /player/video.c
parent0ec6df2ddfc6eb22de3c4f98c78d291997a5e93d (diff)
downloadmpv-cdb25d5a21e2502fef51c2ae7ae387bf990ab73d.tar.bz2
mpv-cdb25d5a21e2502fef51c2ae7ae387bf990ab73d.tar.xz
video: change automatic rotation and 3D filter insertion
We inserted these filters with fixed parameters, which was ok. But this also didn't change image parameters for the filters down the filter chain and the VO. For example, if rotation by 90° was requested by the file, we would insert a filter and rotate the video, but the VO would still receive image parameters that direct rotation by 90°. This wasn't a problem, but it could become one. Fix this by letting the filters automatically pick up the image params. The image params are reset on application. (We could probably also always try to apply and reset image params in a filter, instead of having special "auto" parameters. This would probably work, and video.c would insert a "rotate=0" filter. But I'm afraid this would be confusing and the current solution is cosmetically slightly nicer.) Unfortunately, the vf_stereo3d.c change turned out a big mess, but once the "internal" filter is fully replaced with libavfilter, most of this can be radically simplified.
Diffstat (limited to 'player/video.c')
-rw-r--r--player/video.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/player/video.c b/player/video.c
index 61c7914920..3d308ae955 100644
--- a/player/video.c
+++ b/player/video.c
@@ -147,9 +147,7 @@ static void filter_reconfig(struct MPContext *mpctx,
if (params.rotate && (params.rotate % 90 == 0)) {
if (!(mpctx->video_out->driver->caps & VO_CAP_ROTATE90)) {
// Try to insert a rotation filter.
- char deg[10];
- snprintf(deg, sizeof(deg), "%d", params.rotate);
- char *args[] = {"angle", deg, NULL, NULL};
+ char *args[] = {"angle", "auto", NULL};
if (try_filter(mpctx, params, "rotate", "autorotate", args) >= 0) {
params.rotate = 0;
} else {
@@ -161,10 +159,9 @@ static void filter_reconfig(struct MPContext *mpctx,
if (params.stereo_in != params.stereo_out &&
params.stereo_in > 0 && params.stereo_out >= 0)
{
- char *from = MP_STEREO3D_NAME(params.stereo_in);
char *to = MP_STEREO3D_NAME(params.stereo_out);
- if (from && to) {
- char *args[] = {"in", from, "out", to, NULL, NULL};
+ if (to) {
+ char *args[] = {"in", "auto", "out", to, NULL, NULL};
if (try_filter(mpctx, params, "stereo3d", "stereo3d", args) < 0)
MP_ERR(mpctx, "Can't insert 3D conversion filter.\n");
}