Index: DOCS/tech/slave.txt =================================================================== --- DOCS/tech/slave.txt (revision 25930) +++ DOCS/tech/slave.txt (working copy) @@ -26,7 +26,12 @@ only if it was not already in paused mode. Please note that "as soon as possible" can be before the command is fully executed. +All commands can be prefixed with "osd_level " to tell MPlayer +use specific osd_level for the following command. +Value of is from 0 to 3. If combined with prefix like "pausing ", +"osd_level " must be in the front of "pausing ". + Available commands ('mplayer -input cmdlist' will print a list): Index: command.c =================================================================== --- command.c (revision 25930) +++ command.c (working copy) @@ -2300,12 +2300,15 @@ sh_audio_t * const sh_audio = mpctx->sh_audio; sh_video_t * const sh_video = mpctx->sh_video; int brk_cmd = 0; + int ori_abs_seek_pos = abs_seek_pos; + int ori_rel_seek_secs = rel_seek_secs; + force_osd_level = cmd->osd_level; if (!set_property_command(mpctx, cmd)) switch (cmd->id) { case MP_CMD_SEEK:{ float v; int abs; - if (sh_video) + if (sh_video && force_osd_level != 0) mpctx->osd_show_percentage = sh_video->fps; v = cmd->args[0].v.f; abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0; @@ -3155,5 +3158,11 @@ if (mpctx->was_paused) mpctx->osd_function = OSD_PAUSE; } + if ((abs_seek_pos != ori_abs_seek_pos || rel_seek_secs != ori_rel_seek_secs) + && (abs_seek_pos || rel_seek_secs)) + force_seek_osd_level = force_osd_level; + else + force_seek_osd_level = -1; + force_osd_level = -1; return brk_cmd; } Index: input/input.c =================================================================== --- input/input.c (revision 25930) +++ input/input.c (working copy) @@ -742,6 +742,7 @@ mp_input_parse_cmd(char* str) { int i,l; int pausing = 0; + int osd = -1; char *ptr,*e; mp_cmd_t *cmd; const mp_cmd_t *cmd_def; @@ -754,6 +755,17 @@ while (str[0] == ' ' || str[0] == '\t') ++str; + if (strncmp(str, "osd_level ", 10) == 0) { + str += 10; + osd = strtol(str, &str, 10); + if (str[0] != ' ' && str[0] != '\t') + return NULL; + do { + ++str; + } + while (str[0] == ' ' || str[0] == '\t'); + } + if (strncmp(str, "pausing ", 8) == 0) { pausing = 1; str = &str[8]; @@ -789,6 +801,7 @@ cmd->id = cmd_def->id; cmd->name = strdup(cmd_def->name); cmd->pausing = pausing; + cmd->osd_level = osd; ptr = str; Index: input/input.h =================================================================== --- input/input.h (revision 25930) +++ input/input.h (working copy) @@ -189,6 +189,7 @@ int nargs; mp_cmd_arg_t args[MP_CMD_MAX_ARGS]; int pausing; + int osd_level; // -1: default, 0-3: force osd level to the value for this cmd } mp_cmd_t; Index: mplayer.c =================================================================== --- mplayer.c (revision 25930) +++ mplayer.c (working copy) @@ -233,6 +233,8 @@ static int list_properties = 0; int osd_level=1; +int force_osd_level = -1; +int force_seek_osd_level = -1; // if nonzero, hide current OSD contents when GetTimerMS() reaches this unsigned int osd_visible; int osd_duration = 1000; @@ -1356,6 +1358,13 @@ va_list va; int r; + // Force to disable osd msgs. + if (force_osd_level == 0) + return; + // Force to display osd msgs matching the force_osd_level. + if (force_osd_level > 0 && level <= force_osd_level) + level = 0; + // look if the id is already in the stack for(msg = osd_msg_stack ; msg && msg->id != id ; last = msg, msg = msg->prev); @@ -1488,7 +1497,7 @@ void set_osd_bar(int type,const char* name,double min,double max,double val) { - if(osd_level < 1) return; + if ((force_osd_level < 0 && osd_level < 1) || force_osd_level == 0) return; if(mpctx->sh_video) { osd_visible = (GetTimerMS() + 1000) | 1; @@ -1532,7 +1541,8 @@ if(mpctx->sh_video) { // fallback on the timer - if(osd_level>=2) { + if(osd_level>=2 || + (mpctx->osd_show_percentage && force_seek_osd_level >= 2)) { int len = demuxer_get_time_length(mpctx->demuxer); int percentage = -1; char percentage_text[10]; @@ -1546,7 +1556,8 @@ else percentage_text[0] = 0; - if (osd_level == 3) + if (osd_level == 3 || + (mpctx->osd_show_percentage && force_seek_osd_level >= 3)) snprintf(osd_text_timer, 63, "%c %02d:%02d:%02d / %02d:%02d:%02d%s", mpctx->osd_function,pts/3600,(pts/60)%60,pts%60, @@ -3836,6 +3847,7 @@ } if(rel_seek_secs || abs_seek_pos){ + force_osd_level = force_seek_osd_level; if (seek(mpctx, rel_seek_secs, abs_seek_pos) >= 0) { // Set OSD: if(!loop_seek){ @@ -3843,6 +3855,9 @@ set_osd_bar(0,"Position",0,100,demuxer_get_percent_pos(mpctx->demuxer)); } } + if (force_seek_osd_level == 0 && mpctx->osd_function != OSD_PAUSE) + mpctx->osd_function = OSD_PLAY; + force_osd_level = -1; rel_seek_secs=0; abs_seek_pos=0; Index: mplayer.h =================================================================== --- mplayer.h (revision 25930) +++ mplayer.h (working copy) @@ -16,6 +16,8 @@ extern float audio_delay; extern int osd_level; +extern int force_osd_level; +extern int force_seek_osd_level; extern unsigned int osd_visible; extern char * font_name;