mirror of
https://github.com/mpv-player/mpv
synced 2025-01-01 04:36:24 +01:00
increase max OSD message size limit
patch by Scaevolus on irc git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28413 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
83ebcb0db7
commit
43744a2d0f
12
mplayer.c
12
mplayer.c
@ -1325,7 +1325,7 @@ struct mp_osd_msg {
|
|||||||
/// Previous message on the stack.
|
/// Previous message on the stack.
|
||||||
mp_osd_msg_t* prev;
|
mp_osd_msg_t* prev;
|
||||||
/// Message text.
|
/// Message text.
|
||||||
char msg[64];
|
char msg[128];
|
||||||
int id,level,started;
|
int id,level,started;
|
||||||
/// Display duration in ms.
|
/// Display duration in ms.
|
||||||
unsigned time;
|
unsigned time;
|
||||||
@ -1362,9 +1362,9 @@ void set_osd_msg(int id, int level, int time, const char* fmt, ...) {
|
|||||||
}
|
}
|
||||||
// write the msg
|
// write the msg
|
||||||
va_start(va,fmt);
|
va_start(va,fmt);
|
||||||
r = vsnprintf(msg->msg, 64, fmt, va);
|
r = vsnprintf(msg->msg, 128, fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
if(r >= 64) msg->msg[63] = 0;
|
if(r >= 128) msg->msg[127] = 0;
|
||||||
// set id and time
|
// set id and time
|
||||||
msg->id = id;
|
msg->id = id;
|
||||||
msg->level = level;
|
msg->level = level;
|
||||||
@ -1505,8 +1505,8 @@ void set_osd_bar(int type,const char* name,double min,double max,double val) {
|
|||||||
|
|
||||||
static void update_osd_msg(void) {
|
static void update_osd_msg(void) {
|
||||||
mp_osd_msg_t *msg;
|
mp_osd_msg_t *msg;
|
||||||
static char osd_text[64] = "";
|
static char osd_text[128] = "";
|
||||||
static char osd_text_timer[64];
|
static char osd_text_timer[128];
|
||||||
|
|
||||||
// we need some mem for vo_osd_text
|
// we need some mem for vo_osd_text
|
||||||
vo_osd_text = (unsigned char*)osd_text;
|
vo_osd_text = (unsigned char*)osd_text;
|
||||||
@ -1514,7 +1514,7 @@ static void update_osd_msg(void) {
|
|||||||
// Look if we have a msg
|
// Look if we have a msg
|
||||||
if((msg = get_osd_msg())) {
|
if((msg = get_osd_msg())) {
|
||||||
if(strcmp(osd_text,msg->msg)) {
|
if(strcmp(osd_text,msg->msg)) {
|
||||||
strncpy((char*)osd_text, msg->msg, 63);
|
strncpy((char*)osd_text, msg->msg, 127);
|
||||||
if(mpctx->sh_video) vo_osd_changed(OSDTYPE_OSD); else
|
if(mpctx->sh_video) vo_osd_changed(OSDTYPE_OSD); else
|
||||||
if(term_osd) mp_msg(MSGT_CPLAYER,MSGL_STATUS,"%s%s\n",term_osd_esc,msg->msg);
|
if(term_osd) mp_msg(MSGT_CPLAYER,MSGL_STATUS,"%s%s\n",term_osd_esc,msg->msg);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user