summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-06 17:40:51 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-06 17:40:51 +0000
commitce587559f7906aca349894164d8dc22419866949 (patch)
tree5d6ef5fc1bf3280a068532af8e5d3f0831c50ee7 /mplayer.c
parent1b28b8a9c7aeb47ced6631fa8bd906bcd7ac7cae (diff)
downloadmpv-ce587559f7906aca349894164d8dc22419866949.tar.bz2
mpv-ce587559f7906aca349894164d8dc22419866949.tar.xz
This patch adds the functionality to disable/enable subtitles while playing
a video. I mapped it to the input-keyword "sub_visibility". This keyword is mapped to the 'v' key on the keyboard. I tested the patch with old-fashioned subtitles, with freetype subtitles and DVD subtitles. Works fine. The patch also includes documentation updates. patch by Uwe.Reder@3SOFT.de git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7629 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mplayer.c b/mplayer.c
index aafba8cda2..57c6b6a2d5 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -514,6 +514,7 @@ int osd_function=OSD_PLAY;
int osd_last_pts=-303;
int osd_show_av_delay = 0;
int osd_show_sub_delay = 0;
+int osd_show_sub_visibility = 0;
int rtc_fd=-1;
@@ -2193,6 +2194,13 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
if(sub_pos <0) sub_pos=0;
vo_osd_changed(OSDTYPE_SUBTITLE);
} break;
+ case MP_CMD_SUB_VISIBILITY:
+ {
+ sub_visibility=1-sub_visibility;
+ osd_show_sub_visibility = 9; // show state of subtitle visibility in OSD
+ vo_osd_changed(OSDTYPE_SUBTITLE);
+ break;
+ }
case MP_CMD_SCREENSHOT :
if(vo_config_count) video_out->control(VOCTRL_SCREENSHOT, NULL);
break;
@@ -2557,6 +2565,10 @@ if(rel_seek_secs || abs_seek_pos){
osd_show_dvd_nav_delay--;
} else
#endif
+ if (osd_show_sub_visibility) {
+ sprintf(osd_text_tmp, "Subtitles: %sabled", sub_visibility?"en":"dis");
+ osd_show_sub_visibility--;
+ } else
if (osd_show_sub_delay) {
sprintf(osd_text_tmp, "Sub delay: %d ms",(int)(sub_delay*1000));
osd_show_sub_delay--;