[Mplayer-cvslog] CVS: main mplayer.c,1.589,1.590

Arpi of Ize arpi at mplayerhq.hu
Sun Oct 6 19:41:21 CEST 2002


Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv17868

Modified Files:
	mplayer.c 
Log Message:
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 at 3SOFT.de


Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.589
retrieving revision 1.590
diff -u -r1.589 -r1.590
--- mplayer.c	6 Oct 2002 16:16:53 -0000	1.589
+++ mplayer.c	6 Oct 2002 17:40:48 -0000	1.590
@@ -514,6 +514,7 @@
 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(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 @@
           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--;




More information about the MPlayer-cvslog mailing list