Mercurial > mplayer.hg
changeset 13699:11b249ef87b0
printf --> mp_msg by the Wanderer <inverseparadox at comcast dot net>
author | diego |
---|---|
date | Wed, 20 Oct 2004 01:32:56 +0000 |
parents | 5e3d7843c522 |
children | 23c6d54ce38e |
files | divx4_vbr.c fifo.c find_sub.c help/help_mp-en.h m_config.c |
diffstat | 5 files changed, 39 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/divx4_vbr.c Wed Oct 20 01:25:27 2004 +0000 +++ b/divx4_vbr.c Wed Oct 20 01:32:56 2004 +0000 @@ -23,6 +23,9 @@ #include "divx4_vbr.h" +#include "mp_msg.h" +#include "help_mp.h" + //#include "transcode.h" #define FALSE 0 @@ -201,7 +204,7 @@ m_vFrames = (entry*)malloc(iNumFrames*sizeof(entry)); if (!m_vFrames) - { printf("out of memory"); + { mp_msg(MSGT_FIXME, MSGL_FIXME,MSGTR_OutOfMemory); return -2; //TC_EXPORT_ERROR; } @@ -228,9 +231,7 @@ if(desired_bits<=non_text_bits) { /* char s[200];*/ - printf("Specified bitrate is too low for this clip.\n" - "Minimum possible bitrate for the clip is %.0f kbps. Overriding\n" - "user-specified value.\n", + mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_OverridingTooLowBitrate, (float)(non_text_bits*framerate/(int64_t)iNumFrames)); desired_bits=non_text_bits*3/2;
--- a/fifo.c Wed Oct 20 01:25:27 2004 +0000 +++ b/fifo.c Wed Oct 20 01:32:56 2004 +0000 @@ -7,7 +7,7 @@ static void make_pipe(int* pr,int* pw){ int temp[2]; - if(pipe(temp)!=0) printf("Cannot make PIPE!\n"); + if(pipe(temp)!=0) mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_CannotMakePipe); *pr=temp[0]; *pw=temp[1]; }
--- a/find_sub.c Wed Oct 20 01:25:27 2004 +0000 +++ b/find_sub.c Wed Oct 20 01:32:56 2004 +0000 @@ -12,6 +12,9 @@ #include "libvo/sub.h" #include "subreader.h" +#include "mp_msg.h" +#include "help_mp.h" + static int current_sub=0; //static subtitle* subtitles=NULL; @@ -144,7 +147,7 @@ } } - printf("SUB ERROR: %d ? %d --- %d [%d] \n",key,(int)vo_sub->start,(int)vo_sub->end,current_sub); + mp_msg(MSGT_FIXME,MSGL_FIXME,"SUB ERROR: %d ? %d --- %d [%d] \n",key,(int)vo_sub->start,(int)vo_sub->end,current_sub); vo_sub=NULL; // no sub here }
--- a/help/help_mp-en.h Wed Oct 20 01:25:27 2004 +0000 +++ b/help/help_mp-en.h Wed Oct 20 01:32:56 2004 +0000 @@ -430,6 +430,25 @@ #define MSGTR_CodecDefinitionIncorrect "Codec is not defined correctly." #define MSGTR_OutdatedCodecsConf "This codecs.conf is too old and incompatible with this MPlayer release!" +// divx4_vbr.c: +#define MSGTR_OutOfMemory "out of memory" +#define MSGTR_OverridingTooLowBitrate "Specified bitrate is too low for this clip.\n"\ +"Minimum possible bitrate for the clip is %.0f kbps. Overriding\n"\ +"user-specified value.\n" + +// fifo.c +#define MSGTR_CannotMakePipe "Cannot make PIPE!\n" + +// m_config.c +#define MSGTR_SaveSlotTooOld "Too old save slot found from lvl %d: %d !!!\n" +#define MSGTR_InvalidCfgfileOption "The %s option can't be used in a config file\n" +#define MSGTR_InvalidCmdlineOption "The %s option can't be used on the command line\n" +#define MSGTR_InvalidSuboption "Error: option '%s' has no suboption '%s'\n" +#define MSGTR_MissingSuboptionParameter "Error: suboption '%s' of '%s' must have a parameter!\n" +#define MSGTR_MissingOptionParameter "Error: option '%s' must have a parameter!\n" +#define MSGTR_OptionListHeader "\n Name Type Min Max Global CL Cfg\n\n" +#define MSGTR_TotalOptions "\nTotal: %d options\n" + // open.c, stream.c: #define MSGTR_CdDevNotfound "CD-ROM Device '%s' not found.\n" #define MSGTR_ErrTrackSelect "Error selecting VCD track."
--- a/m_config.c Wed Oct 20 01:25:27 2004 +0000 +++ b/m_config.c Wed Oct 20 01:32:56 2004 +0000 @@ -11,6 +11,7 @@ #include "m_config.h" #include "m_option.h" #include "mp_msg.h" +#include "help_mp.h" m_config_t* m_config_new(void) { @@ -104,7 +105,7 @@ if(co->flags & M_CFG_OPT_ALIAS) continue; if(co->slots->lvl > config->lvl) - mp_msg(MSGT_CFGPARSER, MSGL_WARN,"Too old save slot found from lvl %d : %d !!!\n",config->lvl,co->slots->lvl); + mp_msg(MSGT_CFGPARSER, MSGL_WARN,MSGTR_SaveSlotTooOld,config->lvl,co->slots->lvl); while(co->slots->lvl >= config->lvl) { m_option_free(co->opt,co->slots->data); @@ -239,11 +240,11 @@ // Check if this option isn't forbiden in the current mode if((config->mode == M_CONFIG_FILE) && (co->opt->flags & M_OPT_NOCFG)) { - mp_msg(MSGT_CFGPARSER, MSGL_ERR,"The %s option can't be used in a config file\n",arg); + mp_msg(MSGT_CFGPARSER, MSGL_ERR,MSGTR_InvalidCfgfileOption,arg); return M_OPT_INVALID; } if((config->mode == M_COMMAND_LINE) && (co->opt->flags & M_OPT_NOCMD)) { - mp_msg(MSGT_CFGPARSER, MSGL_ERR,"The %s option can't be used on the command line\n",arg); + mp_msg(MSGT_CFGPARSER, MSGL_ERR,MSGTR_InvalidCmdlineOption,arg); return M_OPT_INVALID; } @@ -264,11 +265,11 @@ sr = m_config_parse_option(config,n,lst[2*i+1],set); if(sr < 0){ if(sr == M_OPT_UNKNOWN){ - mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Error: option '%s' has no suboption '%s'\n",co->name,lst[2*i]); + mp_msg(MSGT_CFGPARSER, MSGL_ERR,MSGTR_InvalidSuboption,co->name,lst[2*i]); r = M_OPT_INVALID; } else if(sr == M_OPT_MISSING_PARAM){ - mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Error: suboption '%s' of '%s' must have a parameter!\n",lst[2*i],co->name); + mp_msg(MSGT_CFGPARSER, MSGL_ERR,MSGTR_MissingSuboptionParameter,lst[2*i],co->name); r = M_OPT_INVALID; } else r = sr; @@ -305,7 +306,7 @@ mp_msg(MSGT_CFGPARSER, MSGL_DBG2,"Checking %s=%s\n",arg,param); r=m_config_parse_option(config,arg,param,0); if(r==M_OPT_MISSING_PARAM){ - mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Error: option '%s' must have a parameter!\n",arg); + mp_msg(MSGT_CFGPARSER, MSGL_ERR,MSGTR_MissingOptionParameter,arg); return M_OPT_INVALID; } return r; @@ -351,7 +352,7 @@ if(!config->opts) return; - printf("\n Name Type Min Max Global CL Cfg\n\n"); + mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_OptionListHeader); for(co = config->opts ; co ; co = co->next) { m_option_t* opt = co->opt; if(opt->type->flags & M_OPT_TYPE_HAS_CHILD) continue; @@ -363,7 +364,7 @@ sprintf(max,"%-8.0f",opt->max); else strcpy(max,"No"); - printf(" %-20.20s %-15.15s %-10.10s %-10.10s %-3.3s %-3.3s %-3.3s\n", + mp_msg(MSGT_FIXME, MSGL_FIXME, " %-20.20s %-15.15s %-10.10s %-10.10s %-3.3s %-3.3s %-3.3s\n", co->name, co->opt->type->name, min, @@ -373,5 +374,5 @@ opt->flags & CONF_NOCFG ? "No" : "Yes"); count++; } - printf("\nTotal: %d options\n",count); + mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_TotalOptions,count); }