diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-06 17:40:51 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-06 17:40:51 +0000 |
commit | ce587559f7906aca349894164d8dc22419866949 (patch) | |
tree | 5d6ef5fc1bf3280a068532af8e5d3f0831c50ee7 /libvo | |
parent | 1b28b8a9c7aeb47ced6631fa8bd906bcd7ac7cae (diff) | |
download | mpv-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 'libvo')
-rw-r--r-- | libvo/sub.c | 7 | ||||
-rw-r--r-- | libvo/sub.h | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/libvo/sub.c b/libvo/sub.c index 797f5fb08d..90dd6c6869 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -33,6 +33,7 @@ unsigned char* vo_osd_text=NULL; int sub_unicode=0; int sub_utf8=0; int sub_pos=100; +int sub_visibility=1; // return the real height of a char: static inline int get_height(int c,int h){ @@ -298,8 +299,8 @@ inline static void vo_update_text_sub(mp_osd_obj_t* obj,int dxs,int dys){ int h,lasth; obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE; - - if(!vo_sub || !vo_font){ + + if(!vo_sub || !vo_font || !sub_visibility){ obj->flags&=~OSDFLAG_VISIBLE; return; } @@ -504,7 +505,7 @@ int vo_update_osd(int dxs,int dys){ vo_update_text_progbar(obj,dxs,dys); break; case OSDTYPE_SPU: - if(vo_spudec && spudec_visible(vo_spudec)){ + if(sub_visibility && vo_spudec && spudec_visible(vo_spudec)){ vo_update_spudec_sub(obj, dxs, dys); obj->flags|=OSDFLAG_VISIBLE|OSDFLAG_CHANGED; } diff --git a/libvo/sub.h b/libvo/sub.h index 33fc278cbb..5646535f42 100644 --- a/libvo/sub.h +++ b/libvo/sub.h @@ -97,6 +97,7 @@ extern int sub_utf8; extern char *sub_cp; #endif extern int sub_pos; +extern int sub_visibility; //extern void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); //extern void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); |