Mercurial > mplayer.hg
changeset 1584:e49b3927c793
more messages for translator :)
author | arpi |
---|---|
date | Sat, 18 Aug 2001 20:32:09 +0000 |
parents | ca7bf882d2f8 |
children | 6edcd01a6c0a |
files | demuxer.c help_mp.h mplayer.c open.c |
diffstat | 4 files changed, 66 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/demuxer.c Sat Aug 18 19:52:14 2001 +0000 +++ b/demuxer.c Sat Aug 18 20:32:09 2001 +0000 @@ -9,6 +9,7 @@ #include "config.h" #include "mp_msg.h" +#include "help_mp.h" #include "stream.h" #include "demuxer.h" @@ -63,7 +64,7 @@ sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id){ if(demuxer->a_streams[id]){ - mp_msg(MSGT_DEMUXER,MSGL_WARN,"Warning! Audio stream header %d redefined!\n",id); + mp_msg(MSGT_DEMUXER,MSGL_WARN,MSGTR_AudioStreamRedefined,id); } else { mp_msg(MSGT_DEMUXER,MSGL_V,"==> Found audio stream: %d\n",id); demuxer->a_streams[id]=malloc(sizeof(sh_audio_t)); @@ -74,7 +75,7 @@ sh_video_t* new_sh_video(demuxer_t *demuxer,int id){ if(demuxer->v_streams[id]){ - mp_msg(MSGT_DEMUXER,MSGL_WARN,"Warning! video stream header %d redefined!\n",id); + mp_msg(MSGT_DEMUXER,MSGL_WARN,MSGTR_VideoStreamRedefined,id); } else { mp_msg(MSGT_DEMUXER,MSGL_V,"==> Found video stream: %d\n",id); demuxer->v_streams[id]=malloc(sizeof(sh_video_t)); @@ -175,13 +176,13 @@ return 1; //ds->buffer_size; } if(demux->audio->packs>=MAX_PACKS || demux->audio->bytes>=MAX_PACK_BYTES){ - mp_msg(MSGT_DEMUXER,MSGL_ERR,"\nDEMUXER: Too many (%d in %d bytes) audio packets in the buffer!\n",demux->audio->packs,demux->audio->bytes); - mp_msg(MSGT_DEMUXER,MSGL_HINT,"(maybe you play a non-interleaved stream/file or audio codec failed)\n"); + mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_TooManyAudioInBuffer,demux->audio->packs,demux->audio->bytes); + mp_msg(MSGT_DEMUXER,MSGL_HINT,MSGTR_MaybeNI); break; } if(demux->video->packs>=MAX_PACKS || demux->video->bytes>=MAX_PACK_BYTES){ - mp_msg(MSGT_DEMUXER,MSGL_ERR,"\nDEMUXER: Too many (%d in %d bytes) video packets in the buffer!\n",demux->video->packs,demux->video->bytes); - mp_msg(MSGT_DEMUXER,MSGL_HINT,"(maybe you play a non-interleaved stream/file or video codec failed)\n"); + mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_TooManyVideoInBuffer,demux->video->packs,demux->video->bytes); + mp_msg(MSGT_DEMUXER,MSGL_HINT,MSGTR_MaybeNI); break; } if(!demux_fill_buffer(demux,ds)){ @@ -328,7 +329,7 @@ stream_read_dword_le(demuxer->stream); //filesize id=stream_read_dword_le(demuxer->stream); // "AVI " if(id==formtypeAVI){ - mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected AVI file format!\n"); + mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedAVIfile); file_format=DEMUXER_TYPE_AVI; } } @@ -338,7 +339,7 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_ASF){ demuxer=new_demuxer(stream,DEMUXER_TYPE_ASF,audio_id,video_id,dvdsub_id); if(asf_check_header(demuxer)){ - mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected ASF file format!\n"); + mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedASFfile); file_format=DEMUXER_TYPE_ASF; } } @@ -350,9 +351,9 @@ if(!pes) demuxer->synced=1; // hack! if(ds_fill_buffer(demuxer->video)){ if(!pes) - mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected MPEG-PES file format!\n"); + mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedMPEGPESfile); else - mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected MPEG-PS file format!\n"); + mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedMPEGPSfile); file_format=DEMUXER_TYPE_MPEG_PS; } else { // some hack to get meaningfull error messages to our unhappy users: @@ -364,7 +365,7 @@ file_format=DEMUXER_TYPE_MPEG_ES; // <-- hack is here :) } else { if(demuxer->synced==2) - mp_msg(MSGT_DEMUXER,MSGL_ERR,"Missing MPEG video stream!? contact the author, it may be a bug :(\n"); + mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_MissingMpegVideo); else mp_msg(MSGT_DEMUXER,MSGL_V,"Not MPEG System Stream format... (maybe Transport Stream?)\n"); } @@ -376,10 +377,10 @@ if(file_format==DEMUXER_TYPE_MPEG_ES){ // little hack, see above! demuxer=new_demuxer(stream,DEMUXER_TYPE_MPEG_ES,audio_id,video_id,dvdsub_id); if(!ds_fill_buffer(demuxer->video)){ - mp_msg(MSGT_DEMUXER,MSGL_ERR,"Invalid MPEG-ES stream??? contact the author, it may be a bug :(\n"); + mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_InvalidMPEGES); file_format=DEMUXER_TYPE_UNKNOWN; } else { - mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected MPEG-ES file format!\n"); + mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedMPEGESfile); } } //=============== Try to open as MOV file: ================= @@ -387,15 +388,14 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MOV){ demuxer=new_demuxer(stream,DEMUXER_TYPE_MOV,audio_id,video_id,dvdsub_id); if(mov_check_file(demuxer)){ - mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected QuickTime/MOV file format!\n"); + mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedQTMOVfile); file_format=DEMUXER_TYPE_MOV; } } #endif //=============== Unknown, exiting... =========================== if(file_format==DEMUXER_TYPE_UNKNOWN){ - mp_msg(MSGT_DEMUXER,MSGL_ERR,"============= Sorry, this file format not recognized/supported ===============\n"); - mp_msg(MSGT_DEMUXER,MSGL_ERR,"=== If this file is an AVI, ASF or MPEG stream, please contact the author! ===\n"); + mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_FormatNotRecognized); return NULL; // GUI_MSG( mplUnknowFileType ) // exit(1); @@ -424,7 +424,7 @@ // demuxer->idx_pos=0; // demuxer->endpos=avi_header.movi_end; if(!ds_fill_buffer(d_video)){ - mp_msg(MSGT_DEMUXER,MSGL_WARN,"ASF: no video stream found!\n"); + mp_msg(MSGT_DEMUXER,MSGL_WARN,MSGTR_MissingASFvideo); sh_video=NULL; //printf("ASF: missing video stream!? contact the author, it may be a bug :(\n"); //GUI_MSG( mplASFErrorMissingVideoStream ) @@ -442,7 +442,7 @@ if(audio_id!=-2){ mp_msg(MSGT_DEMUXER,MSGL_V,"ASF: Searching for audio stream (id:%d)\n",d_audio->id); if(!ds_fill_buffer(d_audio)){ - mp_msg(MSGT_DEMUXER,MSGL_INFO,"ASF: No Audio stream found... ->nosound\n"); + mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_MissingASFaudio); sh_audio=NULL; } else { sh_audio=d_audio->sh;sh_audio->ds=d_audio; @@ -461,7 +461,7 @@ sh_video=d_video->sh;sh_video->ds=d_video; if(audio_id!=-2) { if(!ds_fill_buffer(d_audio)){ - mp_msg(MSGT_DEMUXER,MSGL_INFO,"MPEG: No Audio stream found... ->nosound\n"); + mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_MissingMPEGaudio); sh_audio=NULL; } else { sh_audio=d_audio->sh;sh_audio->ds=d_audio;
--- a/help_mp.h Sat Aug 18 19:52:14 2001 +0000 +++ b/help_mp.h Sat Aug 18 20:32:09 2001 +0000 @@ -1,3 +1,4 @@ +#ifdef HELP_MP_DEFINE_STATIC static char* banner_text= "\n\n" "MPlayer " VERSION "(C) 2000-2001 Arpad Gereoffy (see DOCS/AUTHORS)\n" @@ -39,6 +40,7 @@ "\n" " * * * SEE MANPAGE FOR DETAILS, FURTHER OPTIONS AND KEYS ! * * *\n" "\n"; +#endif // mplayer.c: @@ -82,3 +84,35 @@ "\n** Your system is too SLOW to play this! try with -framedrop or RTFM! **"\ "\n************************************************************************\n" //#define MSGTR_ + +// open.c: +#define MSGTR_CdDevNotfound "CD-ROM Device '%s' not found!\n" +#define MSGTR_ErrTrackSelect "Error selecting VCD track!" +#define MSGTR_ReadSTDIN "Reading from stdin...\n" +#define MSGTR_UnableOpenURL "Unable to open URL: %s\n" +#define MSGTR_ConnToServer "Connected to server: %s\n" +#define MSGTR_FileNotFound "File not found: '%s'\n" + +// demuxer.c: +#define MSGTR_AudioStreamRedefined "Warning! Audio stream header %d redefined!\n" +#define MSGTR_VideoStreamRedefined "Warning! video stream header %d redefined!\n" +#define MSGTR_TooManyAudioInBuffer "\nDEMUXER: Too many (%d in %d bytes) audio packets in the buffer!\n" +#define MSGTR_TooManyVideoInBuffer "\nDEMUXER: Too many (%d in %d bytes) video packets in the buffer!\n" +#define MSGTR_MaybeNI "(maybe you play a non-interleaved stream/file or the codec failed)\n" +#define MSGTR_DetectedAVIfile "Detected AVI file format!\n" +#define MSGTR_DetectedASFfile "Detected ASF file format!\n" +#define MSGTR_DetectedMPEGPESfile "Detected MPEG-PES file format!\n" +#define MSGTR_DetectedMPEGPSfile "Detected MPEG-PS file format!\n" +#define MSGTR_DetectedMPEGESfile "Detected MPEG-ES file format!\n" +#define MSGTR_DetectedQTMOVfile "Detected QuickTime/MOV file format!\n" +#define MSGTR_MissingMpegVideo "Missing MPEG video stream!? contact the author, it may be a bug :(\n" +#define MSGTR_InvalidMPEGES "Invalid MPEG-ES stream??? contact the author, it may be a bug :(\n" +#define MSGTR_FormatNotRecognized "============= Sorry, this file format not recognized/supported ===============\n"\ + "=== If this file is an AVI, ASF or MPEG stream, please contact the author! ===\n" +#define MSGTR_MissingASFvideo "ASF: no video stream found!\n" +#define MSGTR_MissingASFaudio "ASF: No Audio stream found... ->nosound\n" +#define MSGTR_MissingMPEGaudio "MPEG: No Audio stream found... ->nosound\n" + +//#define MSGTR_ + +
--- a/mplayer.c Sat Aug 18 19:52:14 2001 +0000 +++ b/mplayer.c Sat Aug 18 20:32:09 2001 +0000 @@ -20,8 +20,12 @@ #include "version.h" #include "config.h" + #include "mp_msg.h" +#define HELP_MP_DEFINE_STATIC +#include "help_mp.h" + #include "cfgparser.h" #include "cfg-mplayer-def.h" @@ -61,8 +65,6 @@ #include "lirc_mp.h" #endif -#include "help_mp.h" - #define DEBUG if(0) #ifdef HAVE_GUI
--- a/open.c Sat Aug 18 19:52:14 2001 +0000 +++ b/open.c Sat Aug 18 20:32:09 2001 +0000 @@ -7,6 +7,7 @@ #include "config.h" #include "mp_msg.h" +#include "help_mp.h" #ifdef __FreeBSD__ #include <sys/cdrio.h> @@ -40,12 +41,12 @@ if(vcd_track){ int ret,ret2; f=open(filename,O_RDONLY); - if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,"CD-ROM Device '%s' not found!\n",filename);return NULL; } + if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CdDevNotfound,filename);return NULL; } vcd_read_toc(f); ret2=vcd_get_track_end(f,vcd_track); - if(ret2<0){ mp_msg(MSGT_OPEN,MSGL_ERR,"Error selecting VCD track! (get)\n");return NULL;} + if(ret2<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_ErrTrackSelect " (get)\n");return NULL;} ret=vcd_seek_to_track(f,vcd_track); - if(ret<0){ mp_msg(MSGT_OPEN,MSGL_ERR,"Error selecting VCD track! (seek)\n");return NULL;} + if(ret<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_ErrTrackSelect " (seek)\n");return NULL;} // seek_to_byte+=ret; mp_msg(MSGT_OPEN,MSGL_V,"VCD start byte position: 0x%X end: 0x%X\n",ret,ret2); #ifdef VCD_CACHE @@ -65,7 +66,7 @@ //============ Open STDIN ============ if(!strcmp(filename,"-")){ // read from stdin - mp_msg(MSGT_OPEN,MSGL_INFO,"Reading from stdin...\n"); + mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ReadSTDIN); f=0; // 0=stdin stream=new_stream(f,STREAMTYPE_STREAM); return stream; @@ -76,13 +77,13 @@ if(url) { (*file_format)=autodetectProtocol( url, &f ); if( (*file_format)==DEMUXER_TYPE_UNKNOWN ) { - mp_msg(MSGT_OPEN,MSGL_ERR,"Unable to open URL: %s\n", filename); + mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_UnableOpenURL, filename); url_free(url); return NULL; } f=streaming_start( &url, f, file_format ); - if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,"Unable to open URL: %s\n", url->url); return NULL; } - mp_msg(MSGT_OPEN,MSGL_INFO,"Connected to server: %s\n", url->hostname ); + if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_UnableOpenURL, url->url); return NULL; } + mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ConnToServer, url->hostname ); stream=new_stream(f,STREAMTYPE_STREAM); return NULL; } @@ -90,7 +91,7 @@ //============ Open plain FILE ============ f=open(filename,O_RDONLY); - if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,"File not found: '%s'\n",filename);return NULL; } + if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_FileNotFound,filename);return NULL; } len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET); if (len == -1) perror("Error: lseek failed to obtain video file size");