CVS: main mplayer.c,1.889,1.890
CVS change done by Alban Bedel CVS Update of /cvsroot/mplayer/main In directory mail:/var2/tmp/cvs-serv13254 Modified Files: mplayer.c Log Message: Add a function to remove osd msg and use it to remove the "OSD: enabled" msg when switching the OSD to a level above 1. Index: mplayer.c =================================================================== RCS file: /cvsroot/mplayer/main/mplayer.c,v retrieving revision 1.889 retrieving revision 1.890 diff -u -r1.889 -r1.890 --- mplayer.c 20 Nov 2005 23:44:46 -0000 1.889 +++ mplayer.c 27 Nov 2005 23:29:33 -0000 1.890 @@ -1104,6 +1104,29 @@ } /** + * \brief Remove a message from the OSD stack + * + * This function can be used to get rid of a message right away. + * + */ + +static void rm_osd_msg(int id) { + mp_osd_msg_t *msg,*last=NULL; + + // Search for the msg + for(msg = osd_msg_stack ; msg && msg->id != id ; + last = msg, msg = msg->prev); + if(!msg) return; + + // Detach it from the stack and free it + if(last) + last->prev = msg->prev; + else + osd_msg_stack = msg->prev; + free(msg); +} + +/** * \brief Get the current message fron the OSD stack * * This function decrement the message timer and destroy the old ones. @@ -3248,6 +3271,8 @@ if (v == -1 && osd_level <= 1) set_osd_msg(OSD_MSG_OSD_STATUS,0,osd_duration, MSGTR_OSDosd, osd_level ? MSGTR_OSDenabled : MSGTR_OSDdisabled); + else + rm_osd_msg(OSD_MSG_OSD_STATUS); } break; case MP_CMD_OSD_SHOW_TEXT : { set_osd_msg(OSD_MSG_TEXT,1,osd_duration,"%64s",cmd->args[0].v.s);
participants (1)
-
syncmail@mplayerhq.hu