diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-23 01:37:43 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-23 01:37:43 +0000 |
commit | 725ff339e7093f11e1da39156cf7266dd6582f09 (patch) | |
tree | bdbd9ed7cb6e62dfa5798acfa251efab26d4b8a7 /mplayer.c | |
parent | 38c4cdcfc587804cdb2dbb9f980ded0ca2659978 (diff) | |
download | mpv-725ff339e7093f11e1da39156cf7266dd6582f09.tar.bz2 mpv-725ff339e7093f11e1da39156cf7266dd6582f09.tar.xz |
This patch adds support for vertical subtitle alignment
control. Possible values are top, center, and bottom,
with bottom being the default. Alignment is relevant when
it comes to positioning subtitles with one line (or fewer
lines) of text relative to multi-line subtitles.
It is implemented as a new command (sub_alignment) that
without an argument cycles the alignment (between top,
center, and bottom), or with an argument sets the
alignment (0 for top, 1 for center, 2 for bottom).
The key 'i' is bound to this command.
patch by Oskar Liljeblad (oskar@osk.mine.nu)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8535 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r-- | mplayer.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -575,6 +575,7 @@ int osd_show_av_delay = 0; int osd_show_sub_delay = 0; int osd_show_sub_pos = 0; int osd_show_sub_visibility = 0; +int osd_show_sub_alignment = 0; int osd_show_vobsub_changed = 0; int rtc_fd=-1; @@ -2485,6 +2486,16 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still) vo_osd_changed(OSDTYPE_SUBTITLE); osd_show_sub_pos = 9; } break; + case MP_CMD_SUB_ALIGNMENT: + { + if (cmd->nargs >= 1) + sub_alignment = cmd->args[0].v.i; + else + sub_alignment = (sub_alignment+1) % 3; + osd_show_sub_alignment = 9; + vo_osd_changed(OSDTYPE_SUBTITLE); + break; + } case MP_CMD_SUB_VISIBILITY: { sub_visibility=1-sub_visibility; @@ -2920,6 +2931,12 @@ if(rel_seek_secs || abs_seek_pos){ sprintf(osd_text_tmp, "Sub position: %d/100", sub_pos); osd_show_sub_pos--; } else + if (osd_show_sub_alignment) { + sprintf(osd_text_tmp, "Sub alignment: %s", + (sub_alignment == 2 ? "bottom" : + (sub_alignment == 1 ? "center" : "top"))); + osd_show_sub_alignment--; + } else if (osd_show_av_delay) { sprintf(osd_text_tmp, "A-V delay: %d ms",(int)(audio_delay*1000)); osd_show_av_delay--; |