summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-03 00:06:29 +0200
committerwm4 <wm4@nowhere>2015-04-03 00:14:45 +0200
commit8fbc64f74e85d3f6bb36697ac66c96e4f7c9caf2 (patch)
treeb6decea455a634590badc0d1b69c5be5ea58edb0 /video/filter
parent8585845c648ea781269f3bd094f54a3b3674fc51 (diff)
downloadmpv-8fbc64f74e85d3f6bb36697ac66c96e4f7c9caf2.tar.bz2
mpv-8fbc64f74e85d3f6bb36697ac66c96e4f7c9caf2.tar.xz
vf_format: allow forcing aspect ratio
Makes vf_dsize completely useless. Unfortunately, even our "official" encoding profiles still use it.
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf_format.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c
index eda35cd104..4abf18b8fe 100644
--- a/video/filter/vf_format.c
+++ b/video/filter/vf_format.c
@@ -42,6 +42,7 @@ struct vf_priv_s {
int stereo_out;
int rotate;
int dw, dh;
+ double dar;
};
static bool is_compatible(int fmt1, int fmt2)
@@ -104,6 +105,8 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in,
out->d_w = p->dw;
if (p->dh > 0)
out->d_h = p->dh;
+ if (p->dar > 0)
+ vf_set_dar(&out->d_w, &out->d_h, out->w, out->h, p->dar);
// Make sure the user-overrides are consistent (no RGB csp for YUV, etc.).
mp_image_params_guess_csp(out);
@@ -140,6 +143,7 @@ static const m_option_t vf_opts_fields[] = {
OPT_INTRANGE("rotate", rotate, 0, -1, 359),
OPT_INT("dw", dw, 0),
OPT_INT("dh", dh, 0),
+ OPT_DOUBLE("dar", dar, 0),
{0}
};