Mercurial > mplayer.hg
changeset 15862:30cd1a5f4274
Make the OSD display state information when cycling OSD states with 'o'.
based on a patch by Paul TT < paulltt - at- hackerjournal - dot - it >
author | diego |
---|---|
date | Thu, 30 Jun 2005 09:38:55 +0000 |
parents | 08919136d33e |
children | 7689a7c41225 |
files | mplayer.c |
diffstat | 1 files changed, 18 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mplayer.c Thu Jun 30 09:04:15 2005 +0000 +++ b/mplayer.c Thu Jun 30 09:38:55 2005 +0000 @@ -1032,6 +1032,7 @@ int osd_show_ontop = 0; int osd_show_rootwin = 0; int osd_show_framedropping = 0; +int osd_show_status = 0; int rtc_fd=-1; @@ -2918,6 +2919,10 @@ osd_level=(osd_level+1)%(MAX_OSD_LEVEL+1); else osd_level= v > MAX_OSD_LEVEL ? MAX_OSD_LEVEL : v; + /* Show OSD state when disabled, but not when an explicit + argument is given to the osd command, i.e. in slave mode. */ + if (v < 0 && osd_level <= 1) + osd_show_status = 9; } #endif } break; @@ -3980,6 +3985,11 @@ //================= Update OSD ==================== #ifdef USE_OSD + if (osd_level == 0 && osd_show_status > 0 && sh_video){ + snprintf(vo_osd_text, 63, "OSD: disabled"); + vo_osd_changed(OSDTYPE_OSD); + osd_show_status--; + } if(osd_level>=1 && sh_video){ int pts=sh_video->pts; char osd_text_tmp[64]; @@ -4111,13 +4121,19 @@ snprintf(osd_text_tmp, 63, "%c %02d:%02d:%02d%s",osd_function,pts/3600,(pts/60)%60,pts%60,percentage_text); } else osd_text_tmp[0]=0; + if (osd_level == 1 && osd_show_status > 0){ + strncpy(osd_text_tmp, "OSD: enabled", 63); + strncpy(vo_osd_text, osd_text_tmp, 63); + vo_osd_changed(OSDTYPE_OSD); + osd_show_status--; + } if(strcmp(vo_osd_text, osd_text_tmp)) { strncpy(vo_osd_text, osd_text_tmp, 63); vo_osd_changed(OSDTYPE_OSD); } } else { - if(vo_osd_text) { - vo_osd_text=NULL; + if(vo_osd_text && osd_show_status <= 0) { + vo_osd_text=NULL; vo_osd_changed(OSDTYPE_OSD); } }