From ba2799502dc3bd0950f7103914d6e1c523e71f9a Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 5 Jun 2007 16:13:00 +0000 Subject: Create a new MSGT for just the status line. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23478 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cfg-common.h | 2 ++ mencoder.c | 6 +++--- mp_msg.c | 1 + mp_msg.h | 2 ++ mplayer.c | 4 ++-- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cfg-common.h b/cfg-common.h index d1817e3d04..234b6ab9e2 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -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} diff --git a/mencoder.c b/mencoder.c index 089473711a..e1c7ef2823 100644 --- a/mencoder.c +++ b/mencoder.c @@ -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, diff --git a/mp_msg.c b/mp_msg.c index abd468e881..9e256df6a4 100644 --- a/mp_msg.c +++ b/mp_msg.c @@ -191,6 +191,7 @@ void mp_msg(int mod, int lev, const char *format, ... ){ "RADIO", "ASS", "LOADER", + "STATUSLINE", }; int c=v_colors[lev]; diff --git a/mp_msg.h b/mp_msg.h index 875f1de4e1..f5c9937cbb 100644 --- a/mp_msg.h +++ b/mp_msg.h @@ -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); diff --git a/mplayer.c b/mplayer.c index df7dd17d10..0c6008b100 100644 --- a/mplayer.c +++ b/mplayer.c @@ -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); } -- cgit v1.2.3