From 333832e130e01e62b7534e9e2edd485bfb884368 Mon Sep 17 00:00:00 2001 From: attila Date: Thu, 29 Jan 2004 12:01:26 +0000 Subject: * changes mencoder's exit code on explicit kill to 2 * add quiet/noquiet to mencoder * dont depend targets on themselfs patch by Oswald Buddenhagen additionaly moved quiet/noquiet and v/verbose to cfg-common.h git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11876 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cfg-common.h | 9 +++++++++ cfg-mencoder.h | 3 --- cfg-mplayer.h | 4 ---- loader/Makefile | 2 +- mencoder.c | 5 ++++- mplayer.c | 2 +- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/cfg-common.h b/cfg-common.h index a1dbafc31b..0ef98d971c 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -1,5 +1,11 @@ #ifdef MAIN_CONF /* this will be included in conf[] */ +// ------------------------- common optionss -------------------- + {"quiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"noquiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, + {"verbose", &verbose, CONF_TYPE_INT, CONF_RANGE|CONF_GLOBAL, 0, 100, NULL}, + {"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOSAVE, 0, 0, NULL}, + // ------------------------- stream options -------------------- #ifdef USE_STREAM_CACHE @@ -266,6 +272,9 @@ #include "config.h" +extern int quiet; +extern int verbose; + // codec/filter opts: (defiend at libmpcodecs/vd.c) extern float screen_size_xy; extern float movie_aspect; diff --git a/cfg-mencoder.h b/cfg-mencoder.h index 7f625b6794..d542407535 100644 --- a/cfg-mencoder.h +++ b/cfg-mencoder.h @@ -230,9 +230,6 @@ m_option_t mencoder_opts[]={ #include "cfg-common.h" #undef MAIN_CONF -// {"quiet", &quiet, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"verbose", &verbose, CONF_TYPE_INT, CONF_RANGE|CONF_GLOBAL, 0, 100, NULL}, - {"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL}, // {"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, // {"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, // {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 76b60bcdbb..25171f97f5 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -420,11 +420,7 @@ m_option_t mplayer_opts[]={ #undef MAIN_CONF {"identify", &identify, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"quiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"noquiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, {"really-quiet", &verbose, CONF_TYPE_FLAG, CONF_GLOBAL, 0, -10, NULL}, - {"verbose", &verbose, CONF_TYPE_INT, CONF_RANGE|CONF_GLOBAL, 0, 100, NULL}, - {"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOSAVE, 0, 0, NULL}, {"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, {"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, diff --git a/loader/Makefile b/loader/Makefile index b806eec9e2..ebf576c89d 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -27,7 +27,7 @@ clean: distclean: clean -.c.o: $@ +.c.o: $(CC) $(CFLAGS) $(DEFINES) -c $< libloader.a: $(LIB_OBJECTS) stubs.s diff --git a/mencoder.c b/mencoder.c index 0bfe7ace97..c376a83f01 100644 --- a/mencoder.c +++ b/mencoder.c @@ -129,6 +129,7 @@ int out_file_format=MUXER_TYPE_AVI; // default to AVI //void resync_audio_stream(sh_audio_t *sh_audio){} int verbose=0; // must be global! +int quiet=0; double video_time_usage=0; double vout_time_usage=0; double max_video_time_usage=0; @@ -317,7 +318,7 @@ static double end_at; static void exit_sighandler(int x){ at_eof=1; - interrupted=1; + interrupted=2; /* 1 means error */ } static muxer_t* muxer=NULL; @@ -1376,6 +1377,7 @@ if(sh_audio && !demuxer2){ (int)demuxer->filepos, (int)demuxer->movi_end); #else + if(!quiet) { if(verbose>0) { 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", mux_v->timer, decoded_frameno, (int)(p*100), @@ -1398,6 +1400,7 @@ if(sh_audio && !demuxer2){ (mux_v->timer>1) ? (int)(mux_v->size/mux_v->timer/125) : 0, (mux_a && mux_a->timer>1) ? (int)(mux_a->size/mux_a->timer/125) : 0 ); + } #endif } fflush(stdout); diff --git a/mplayer.c b/mplayer.c index 46b5dcb08b..472895f4b0 100644 --- a/mplayer.c +++ b/mplayer.c @@ -82,7 +82,7 @@ extern int mp_input_win32_slave_cmd_func(int fd,char* dest,int size); int slave_mode=0; int verbose=0; int identify=0; -static int quiet=0; +int quiet=0; #define ABS(x) (((x)>=0)?(x):(-(x))) #define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5)) -- cgit v1.2.3