summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorharklu <harklu@wat>2011-08-04 21:47:36 +0200
committerUoti Urpala <uau@mplayer2.org>2011-08-12 14:19:10 +0300
commit9e6933440ae59c523fce85b64d6f52f444910003 (patch)
tree2b54de48e505866e95c946db1b3e497bfcc9867b /command.c
parente30416c9979232bf86cb58992421e66e03eda492 (diff)
downloadmpv-9e6933440ae59c523fce85b64d6f52f444910003.tar.bz2
mpv-9e6933440ae59c523fce85b64d6f52f444910003.tar.xz
options, subs: add --ass-vsfilter-aspect-compat
Add option --ass-vsfilter-aspect-compat and corresponding property ass_vsfilter_aspect_compat. The setting controls whether to enable the emulation of traditional VSFilter behavior where subtitles are stretched if the video is anamorphic (previously always enabled for native SSA/ASS subtitles). Enabled by default. Add 'V' as a new default keybinding to toggle the property.
Diffstat (limited to 'command.c')
-rw-r--r--command.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/command.c b/command.c
index fc8750ea29..1dea8cfaab 100644
--- a/command.c
+++ b/command.c
@@ -1973,6 +1973,27 @@ static int mp_property_ass_use_margins(m_option_t *prop, int action,
return m_property_flag(prop, action, arg, &ass_use_margins);
}
}
+
+static int mp_property_ass_vsfilter_aspect_compat(m_option_t *prop, int action,
+ void *arg, MPContext *mpctx)
+{
+ if (!mpctx->sh_video)
+ return M_PROPERTY_UNAVAILABLE;
+
+ switch (action) {
+ case M_PROPERTY_SET:
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ case M_PROPERTY_STEP_UP:
+ case M_PROPERTY_STEP_DOWN:
+ //has to re-render subs with new aspect ratio
+ mpctx->osd->ass_force_reload = 1;
+ default:
+ return m_property_flag(prop, action, arg,
+ &mpctx->opts.ass_vsfilter_aspect_compat);
+ }
+}
+
#endif
/// Show only forced subtitles (RW)
@@ -2316,6 +2337,8 @@ static const m_option_t mp_properties[] = {
#ifdef CONFIG_ASS
{ "ass_use_margins", mp_property_ass_use_margins, CONF_TYPE_FLAG,
M_OPT_RANGE, 0, 1, NULL },
+ { "ass_vsfilter_aspect_compat", mp_property_ass_vsfilter_aspect_compat,
+ CONF_TYPE_FLAG, M_OPT_RANGE, 0, 1, NULL },
#endif
#ifdef CONFIG_TV
@@ -2427,6 +2450,8 @@ static struct property_osd_display {
#ifdef CONFIG_FREETYPE
{ "sub_scale", 0, -1, _("Sub Scale: %s")},
#endif
+ { "ass_vsfilter_aspect_compat", 0, -1,
+ _("Subtitle VSFilter aspect compat: %s")},
#ifdef CONFIG_TV
{ "tv_brightness", OSD_BRIGHTNESS, -1, _("Brightness") },
{ "tv_hue", OSD_HUE, -1, _("Hue") },