summaryrefslogtreecommitdiffstats
path: root/codec-cfg.c
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-12 11:29:21 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-12 11:29:21 +0000
commit1013ecd44b4bca1735882e434aedabd80b8cf12f (patch)
tree283f025a335badeb5d1cbecd87f39e84c23f91f0 /codec-cfg.c
parentb76c43dd931bd8178e2924510f3af958a5886aed (diff)
downloadmpv-1013ecd44b4bca1735882e434aedabd80b8cf12f.tar.bz2
mpv-1013ecd44b4bca1735882e434aedabd80b8cf12f.tar.xz
Translatable messages moved to help_mp-en.h.
patch by The Wanderer <inverseparadox at comcast dot net> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13620 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'codec-cfg.c')
-rw-r--r--codec-cfg.c60
1 files changed, 31 insertions, 29 deletions
diff --git a/codec-cfg.c b/codec-cfg.c
index 341fb8446a..b60a7429b7 100644
--- a/codec-cfg.c
+++ b/codec-cfg.c
@@ -26,6 +26,8 @@
#include "config.h"
#include "mp_msg.h"
+#include "help_mp.h"
+
// for mmioFOURCC:
#include "libmpdemux/aviheader.h"
@@ -80,13 +82,13 @@ static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc,
goto err_out_parse_error;
return 1;
err_out_duplicated:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"duplicated FourCC");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFourcc);
return 0;
err_out_too_many:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"too many FourCCs/formats...");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs);
return 0;
err_out_parse_error:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"parse error");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError);
return 0;
}
@@ -99,20 +101,20 @@ static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int
for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++)
/* NOTHING */;
if (i == CODECS_MAX_FOURCC) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"too many FourCCs/formats...");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs);
return 0;
}
fourcc[i]=strtoul(s,&endptr,0);
if (*endptr != '\0') {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"parse error (format ID not a number?)");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDNotNumber);
return 0;
}
if(alias){
fourccmap[i]=strtoul(alias,&endptr,0);
if (*endptr != '\0') {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"parse error (format ID alias not a number?)");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDAliasNotNumber);
return 0;
}
} else
@@ -120,7 +122,7 @@ static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int
for (j = 0; j < i; j++)
if (fourcc[j] == fourcc[i]) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"duplicated format ID");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFID);
return 0;
}
@@ -232,10 +234,10 @@ static int add_to_inout(char *sfmt, char *sflags, unsigned int *outfmt,
return 1;
err_out_too_many:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"too many out...");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyOut);
return 0;
err_out_parse_error:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"parse error");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError);
return 0;
}
@@ -318,7 +320,7 @@ static int validate_codec(codecs_t *c, int type)
/* NOTHING */;
if (i < strlen(tmp_name)) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) name is not valid!\n", c->name);
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_InvalidCodecName, c->name);
return 0;
}
@@ -327,13 +329,13 @@ static int validate_codec(codecs_t *c, int type)
#if 0
if (c->fourcc[0] == 0xffffffff) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) does not have FourCC/format!\n", c->name);
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksFourcc, c->name);
return 0;
}
/* XXX fix this: shitty with 'null' codec */
if (!c->driver) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) does not have a driver!\n", c->name);
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksDriver, c->name);
return 0;
}
#endif
@@ -343,7 +345,7 @@ static int validate_codec(codecs_t *c, int type)
#warning HOL VANNAK DEFINIALVA????????????
if (!c->dll && (c->driver == 4 ||
(c->driver == 2 && type == TYPE_VIDEO))) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) needs a 'dll'!\n", c->name);
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsDLL, c->name);
return 0;
}
#warning guid.f1 lehet 0? honnan lehet tudni, hogy nem adtak meg?
@@ -351,7 +353,7 @@ static int validate_codec(codecs_t *c, int type)
if (type == TYPE_VIDEO)
if (c->outfmt[0] == 0xffffffff) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) needs an 'outfmt'!\n", c->name);
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsOutfmt, c->name);
return 0;
}
#endif
@@ -369,7 +371,7 @@ static int add_comment(char *s, char **d)
(*d)[pos++] = '\n';
}
if (!(*d = (char *) realloc(*d, pos + strlen(s) + 1))) {
- mp_msg(MSGT_CODECCFG,MSGL_FATAL,"Can't allocate memory for comment. ");
+ mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantAllocateComment);
return 0;
}
strcpy(*d + pos, s);
@@ -418,7 +420,7 @@ static int get_token(int min, int max)
char c;
if (max >= MAX_NR_TOKEN) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"get_token(): max >= MAX_NR_TOKEN!");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_GetTokenMaxNotLessThanMAX_NR_TOKEN);
goto out_eof;
}
@@ -506,15 +508,15 @@ int parse_codec_cfg(char *cfgfile)
#endif
}
- mp_msg(MSGT_CODECCFG,MSGL_INFO,"Reading %s: ", cfgfile);
+ mp_msg(MSGT_CODECCFG,MSGL_INFO,MSGTR_ReadingFile, cfgfile);
if ((fp = fopen(cfgfile, "r")) == NULL) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"Can't open '%s': %s\n", cfgfile, strerror(errno));
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantOpenFileError, cfgfile, strerror(errno));
return 0;
}
if ((line = (char *) malloc(MAX_LINE_LEN + 1)) == NULL) {
- mp_msg(MSGT_CODECCFG,MSGL_FATAL,"Can't get memory for 'line': %s\n", strerror(errno));
+ mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantGetMemoryForLine, strerror(errno));
return 0;
}
read_nextline = 1;
@@ -572,7 +574,7 @@ int parse_codec_cfg(char *cfgfile)
}
if (!(*codecsp = (codecs_t *) realloc(*codecsp,
sizeof(codecs_t) * (*nr_codecsp + 2)))) {
- mp_msg(MSGT_CODECCFG,MSGL_FATAL,"Can't realloc '*codecsp': %s\n", strerror(errno));
+ mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantReallocCodecsp, strerror(errno));
goto err_out;
}
codec=*codecsp + *nr_codecsp;
@@ -587,19 +589,19 @@ int parse_codec_cfg(char *cfgfile)
for (i = 0; i < *nr_codecsp - 1; i++) {
if(( (*codecsp)[i].name!=NULL) &&
(!strcmp(token[0], (*codecsp)[i].name)) ) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"Codec name '%s' isn't unique.", token[0]);
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNameNotUnique, token[0]);
goto err_out_print_linenum;
}
}
if (!(codec->name = strdup(token[0]))) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'name': %s\n", strerror(errno));
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupName, strerror(errno));
goto err_out;
}
} else if (!strcmp(token[0], "info")) {
if (codec->info || get_token(1, 1) < 0)
goto err_out_parse_error;
if (!(codec->info = strdup(token[0]))) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'info': %s\n", strerror(errno));
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupInfo, strerror(errno));
goto err_out;
}
} else if (!strcmp(token[0], "comment")) {
@@ -623,14 +625,14 @@ int parse_codec_cfg(char *cfgfile)
if (get_token(1, 1) < 0)
goto err_out_parse_error;
if (!(codec->drv = strdup(token[0]))) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'driver': %s\n", strerror(errno));
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDriver, strerror(errno));
goto err_out;
}
} else if (!strcmp(token[0], "dll")) {
if (get_token(1, 1) < 0)
goto err_out_parse_error;
if (!(codec->dll = strdup(token[0]))) {
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'dll': %s\n", strerror(errno));
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDLL, strerror(errno));
goto err_out;
}
} else if (!strcmp(token[0], "guid")) {
@@ -699,7 +701,7 @@ int parse_codec_cfg(char *cfgfile)
}
if (!validate_codec(codec, codec_type))
goto err_out_not_valid;
- mp_msg(MSGT_CODECCFG,MSGL_INFO,"%d audio & %d video codecs\n", nr_acodecs, nr_vcodecs);
+ mp_msg(MSGT_CODECCFG,MSGL_INFO,MSGTR_AudioVideoCodecTotals, nr_acodecs, nr_vcodecs);
if(video_codecs) video_codecs[nr_vcodecs].name = NULL;
if(audio_codecs) audio_codecs[nr_acodecs].name = NULL;
out:
@@ -709,7 +711,7 @@ out:
return 1;
err_out_parse_error:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"parse error");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError);
err_out_print_linenum:
PRINT_LINENUM;
err_out:
@@ -726,10 +728,10 @@ err_out:
fclose(fp);
return 0;
err_out_not_valid:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"Codec is not defined correctly.");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecDefinitionIncorrect);
goto err_out_print_linenum;
err_out_release_num:
- mp_msg(MSGT_CODECCFG,MSGL_ERR,"This codecs.conf is too old and incompatible with this MPlayer release!");
+ mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_OutdatedCodecsConf);
goto err_out_print_linenum;
}