diff options
author | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-01-23 21:18:32 +0000 |
---|---|---|
committer | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-01-23 21:18:32 +0000 |
commit | f817a5dc521e9302a142cdef19488410606e6ae9 (patch) | |
tree | 325cf5a7951b965f1656e7f8281a480211aeb6ec /command.c | |
parent | 00cce8eb303195eb779a5bedbe38d52d3adb61dd (diff) | |
download | mpv-f817a5dc521e9302a142cdef19488410606e6ae9.tar.bz2 mpv-f817a5dc521e9302a142cdef19488410606e6ae9.tar.xz |
Add ass_use_margins command and property to shift subtitles to margins and back
on the fly.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25842 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -1742,6 +1742,27 @@ static int mp_property_sub_visibility(m_option_t * prop, int action, } } +#ifdef USE_ASS +/// Use margins for libass subtitles (RW) +static int mp_property_ass_use_margins(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: + ass_force_reload = 1; + default: + return m_property_flag(prop, action, arg, &ass_use_margins); + } +} +#endif + /// Show only forced subtitles (RW) static int mp_property_sub_forced_only(m_option_t * prop, int action, void *arg, MPContext * mpctx) @@ -2049,6 +2070,10 @@ static const m_option_t mp_properties[] = { { "sub_scale", mp_property_sub_scale, CONF_TYPE_FLOAT, M_OPT_RANGE, 0, 100, NULL }, #endif +#ifdef USE_ASS + { "ass_use_margins", mp_property_ass_use_margins, CONF_TYPE_FLAG, + M_OPT_RANGE, 0, 1, NULL }, +#endif #ifdef USE_TV { "tv_brightness", mp_property_tv_color, CONF_TYPE_INT, @@ -2177,6 +2202,9 @@ static struct { #ifdef HAVE_FREETYPE { "sub_scale", MP_CMD_SUB_SCALE, 0, 0, -1, MSGTR_SubScale}, #endif +#ifdef USE_ASS + { "ass_use_margins", MP_CMD_ASS_USE_MARGINS, 1, 0, -1, NULL }, +#endif #ifdef USE_TV { "tv_brightness", MP_CMD_TV_SET_BRIGHTNESS, 0, OSD_BRIGHTNESS, -1, MSGTR_Brightness }, { "tv_hue", MP_CMD_TV_SET_HUE, 0, OSD_HUE, -1, MSGTR_Hue }, |