Create a new MSGT for just the status line.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23478 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2007-06-05 16:13:00 +00:00
parent 5bddf1de61
commit ba2799502d
5 changed files with 10 additions and 5 deletions

View File

@ -626,6 +626,7 @@ m_option_t msgl_config[]={
{ "osd-menu", &mp_msg_levels[MSGT_OSD_MENU], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
{ "identify", &mp_msg_levels[MSGT_IDENTIFY], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
{ "ass", &mp_msg_levels[MSGT_ASS], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
{ "statusline", &mp_msg_levels[MSGT_STATUSLINE], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
{"help", "Available msg modules:\n"
" global - common player errors/information\n"
" cplayer - console player (mplayer.c)\n"
@ -670,6 +671,7 @@ m_option_t msgl_config[]={
" muxer - muxer layer\n"
" identify - identify output\n"
" ass - libass messages\n"
" statusline - playback/encoding status line\n"
"\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
{NULL, NULL, 0, 0, 0, 0, NULL}

View File

@ -1439,8 +1439,8 @@ if(sh_audio && !demuxer2){
(int)demuxer->movi_end);
#else
if(!quiet) {
if( mp_msg_test(MSGT_AVSYNC,MSGL_V) ) {
mp_msg(MSGT_AVSYNC,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %3dfps Trem:%4dmin %3dmb A-V:%5.3f [%d:%d] A/Vms %d/%d D/B/S %d/%d/%d \r",
if( mp_msg_test(MSGT_STATUSLINE,MSGL_V) ) {
mp_msg(MSGT_STATUSLINE,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %3dfps Trem:%4dmin %3dmb A-V:%5.3f [%d:%d] A/Vms %d/%d D/B/S %d/%d/%d \r",
mux_v->timer, decoded_frameno, (int)(p*100),
(t>1) ? (int)(decoded_frameno/t+0.5) : 0,
(p>0.001) ? (int)((t/p-t)/60) : 0,
@ -1452,7 +1452,7 @@ if(sh_audio && !demuxer2){
duplicatedframes, badframes, skippedframes
);
} else
mp_msg(MSGT_AVSYNC,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %5.2ffps Trem:%4dmin %3dmb A-V:%5.3f [%d:%d]\r",
mp_msg(MSGT_STATUSLINE,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %5.2ffps Trem:%4dmin %3dmb A-V:%5.3f [%d:%d]\r",
mux_v->timer, decoded_frameno, (int)(p*100),
(t>1) ? (float)(decoded_frameno/t) : 0,
(p>0.001) ? (int)((t/p-t)/60) : 0,

View File

@ -191,6 +191,7 @@ void mp_msg(int mod, int lev, const char *format, ... ){
"RADIO",
"ASS",
"LOADER",
"STATUSLINE",
};
int c=v_colors[lev];

View File

@ -103,6 +103,8 @@ extern int verbose;
#define MSGT_LOADER 44 // dll loader messages
#define MSGT_STATUSLINE 45 // playback/encoding status line
#define MSGT_MAX 64
void mp_msg_init(void);

View File

@ -1181,11 +1181,11 @@ static void print_status(float a_pos, float a_v, float corr)
// end
if (erase_to_end_of_line) {
line[pos] = 0;
mp_msg(MSGT_AVSYNC, MSGL_STATUS, "%s%s\r", line, erase_to_end_of_line);
mp_msg(MSGT_STATUSLINE, MSGL_STATUS, "%s%s\r", line, erase_to_end_of_line);
} else {
memset(&line[pos], ' ', width - pos);
line[width] = 0;
mp_msg(MSGT_AVSYNC, MSGL_STATUS, "%s\r", line);
mp_msg(MSGT_STATUSLINE, MSGL_STATUS, "%s\r", line);
}
free(line);
}