diff options
Diffstat (limited to 'libmpcodecs')
34 files changed, 277 insertions, 118 deletions
diff --git a/libmpcodecs/ad_acm.c b/libmpcodecs/ad_acm.c index 16f6f11623..870c9a986f 100644 --- a/libmpcodecs/ad_acm.c +++ b/libmpcodecs/ad_acm.c @@ -59,7 +59,7 @@ static int preinit(sh_audio_t *sh_audio) priv->o_wf = malloc(sizeof(WAVEFORMATEX)); if (!priv->o_wf) { - mp_tmsg(MSGT_DECAUDIO,MSGL_ERR,MSGTR_ACMiniterror); + mp_tmsg(MSGT_DECAUDIO,MSGL_ERR,"Could not load/initialize Win32/ACM audio codec (missing DLL file?).\n"); return 0; } @@ -90,7 +90,7 @@ static int preinit(sh_audio_t *sh_audio) else mp_msg(MSGT_WIN32, MSGL_ERR, "ACM_Decoder: acmStreamOpen error: %d\n", (int)ret); - mp_tmsg(MSGT_DECAUDIO,MSGL_ERR,MSGTR_ACMiniterror); + mp_tmsg(MSGT_DECAUDIO,MSGL_ERR,"Could not load/initialize Win32/ACM audio codec (missing DLL file?).\n"); return 0; } mp_msg(MSGT_WIN32, MSGL_V, "Audio codec opened OK! ;-)\n"); diff --git a/libmpcodecs/ad_dmo.c b/libmpcodecs/ad_dmo.c index 4b520ad8c1..d329caadaf 100644 --- a/libmpcodecs/ad_dmo.c +++ b/libmpcodecs/ad_dmo.c @@ -34,7 +34,7 @@ static int preinit(sh_audio_t *sh_audio) audio_output_channels : (sh_audio->wf->nChannels>=2 ? 2 : 1); if(!(ds_adec=DMO_AudioDecoder_Open(sh_audio->codec->dll,&sh_audio->codec->guid,sh_audio->wf,chans))) { - mp_tmsg(MSGT_DECAUDIO,MSGL_ERR,MSGTR_MissingDLLcodec,sh_audio->codec->dll); + mp_tmsg(MSGT_DECAUDIO,MSGL_ERR,"ERROR: Could not open required DirectShow codec %s.\n",sh_audio->codec->dll); return 0; } sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; diff --git a/libmpcodecs/ad_dshow.c b/libmpcodecs/ad_dshow.c index 5811efef03..db6a98cbee 100644 --- a/libmpcodecs/ad_dshow.c +++ b/libmpcodecs/ad_dshow.c @@ -31,7 +31,7 @@ static int preinit(sh_audio_t *sh_audio) DS_AudioDecoder* ds_adec; if(!(ds_adec=DS_AudioDecoder_Open(sh_audio->codec->dll,&sh_audio->codec->guid,sh_audio->wf))) { - mp_tmsg(MSGT_DECAUDIO,MSGL_ERR,MSGTR_MissingDLLcodec,sh_audio->codec->dll); + mp_tmsg(MSGT_DECAUDIO,MSGL_ERR,"ERROR: Could not open required DirectShow codec %s.\n",sh_audio->codec->dll); return 0; } sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; diff --git a/libmpcodecs/ad_dvdpcm.c b/libmpcodecs/ad_dvdpcm.c index cb61b8e24d..943ce73bf0 100644 --- a/libmpcodecs/ad_dvdpcm.c +++ b/libmpcodecs/ad_dvdpcm.c @@ -38,7 +38,7 @@ static int init(sh_audio_t *sh) sh->samplesize = 2; break; case 1: - mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, MSGTR_SamplesWanted); + mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, "Samples of this format are needed to improve support. Please contact the developers.\n"); sh->i_bps = sh->channels * sh->samplerate * 5 / 2; case 2: sh->sample_format = AF_FORMAT_S24_BE; diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c index 2e2d6c67b1..af512368a5 100644 --- a/libmpcodecs/ad_ffmpeg.c +++ b/libmpcodecs/ad_ffmpeg.c @@ -49,7 +49,7 @@ static int init(sh_audio_t *sh_audio) lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh_audio->codec->dll); if(!lavc_codec){ - mp_tmsg(MSGT_DECAUDIO,MSGL_ERR,MSGTR_MissingLAVCcodec,sh_audio->codec->dll); + mp_tmsg(MSGT_DECAUDIO,MSGL_ERR,"Cannot find codec '%s' in libavcodec...\n",sh_audio->codec->dll); return 0; } @@ -88,7 +88,7 @@ static int init(sh_audio_t *sh_audio) /* open it */ if (avcodec_open(lavc_context, lavc_codec) < 0) { - mp_tmsg(MSGT_DECAUDIO,MSGL_ERR, MSGTR_CantOpenCodec); + mp_tmsg(MSGT_DECAUDIO,MSGL_ERR, "Could not open codec.\n"); return 0; } mp_msg(MSGT_DECAUDIO,MSGL_V,"INFO: libavcodec init OK!\n"); @@ -138,7 +138,7 @@ static void uninit(sh_audio_t *sh) AVCodecContext *lavc_context = sh->context; if (avcodec_close(lavc_context) < 0) - mp_tmsg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_CantCloseCodec); + mp_tmsg(MSGT_DECVIDEO, MSGL_ERR, "Could not close codec.\n"); av_freep(&lavc_context->extradata); av_freep(&lavc_context); } diff --git a/libmpcodecs/ad_libdv.c b/libmpcodecs/ad_libdv.c index 364facbc07..b6f077b844 100644 --- a/libmpcodecs/ad_libdv.c +++ b/libmpcodecs/ad_libdv.c @@ -86,7 +86,7 @@ static int decode_audio(sh_audio_t *audio, unsigned char *buf, int minlen, int m dv_parse_header(decoder, dv_audio_frame); if(xx!=decoder->frame_size) - mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_MPCODECS_AudioFramesizeDiffers, + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,"[AD_LIBDV] Warning! Audio framesize differs! read=%d hdr=%d.\n", xx, decoder->frame_size); if (dv_decode_full_audio(decoder, dv_audio_frame,(int16_t**) audioBuffers)) diff --git a/libmpcodecs/ad_realaud.c b/libmpcodecs/ad_realaud.c index 4d964db4d4..e5cab0763e 100644 --- a/libmpcodecs/ad_realaud.c +++ b/libmpcodecs/ad_realaud.c @@ -218,7 +218,7 @@ static int preinit(sh_audio_t *sh){ if (!load_syms_windows(sh->codec->dll)) #endif { - mp_tmsg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_MissingDLLcodec, sh->codec->dll); + mp_tmsg(MSGT_DECVIDEO, MSGL_ERR, "ERROR: Could not open required DirectShow codec %s.\n", sh->codec->dll); mp_msg(MSGT_DECVIDEO, MSGL_HINT, "Read the RealAudio section of the DOCS!\n"); free(path); return 0; diff --git a/libmpcodecs/ae_lame.c b/libmpcodecs/ae_lame.c index 663f619649..6300a68efb 100644 --- a/libmpcodecs/ae_lame.c +++ b/libmpcodecs/ae_lame.c @@ -39,6 +39,55 @@ static char* lame_param_preset=NULL; // unset static int lame_presets_set( lame_t gfp, int fast, int cbr, const char* preset_name ); #endif +#define MEncoderMP3LameHelp _("\n\n"\ +" vbr=<0-4> variable bitrate method\n"\ +" 0: cbr (constant bitrate)\n"\ +" 1: mt (Mark Taylor VBR algorithm)\n"\ +" 2: rh (Robert Hegemann VBR algorithm - default)\n"\ +" 3: abr (average bitrate)\n"\ +" 4: mtrh (Mark Taylor Robert Hegemann VBR algorithm)\n"\ +"\n"\ +" abr average bitrate\n"\ +"\n"\ +" cbr constant bitrate\n"\ +" Also forces CBR mode encoding on subsequent ABR presets modes.\n"\ +"\n"\ +" br=<0-1024> specify bitrate in kBit (CBR and ABR only)\n"\ +"\n"\ +" q=<0-9> quality (0-highest, 9-lowest) (only for VBR)\n"\ +"\n"\ +" aq=<0-9> algorithmic quality (0-best/slowest, 9-worst/fastest)\n"\ +"\n"\ +" ratio=<1-100> compression ratio\n"\ +"\n"\ +" vol=<0-10> set audio input gain\n"\ +"\n"\ +" mode=<0-3> (default: auto)\n"\ +" 0: stereo\n"\ +" 1: joint-stereo\n"\ +" 2: dualchannel\n"\ +" 3: mono\n"\ +"\n"\ +" padding=<0-2>\n"\ +" 0: no\n"\ +" 1: all\n"\ +" 2: adjust\n"\ +"\n"\ +" fast Switch on faster encoding on subsequent VBR presets modes,\n"\ +" slightly lower quality and higher bitrates.\n"\ +"\n"\ +" preset=<value> Provide the highest possible quality settings.\n"\ +" medium: VBR encoding, good quality\n"\ +" (150-180 kbps bitrate range)\n"\ +" standard: VBR encoding, high quality\n"\ +" (170-210 kbps bitrate range)\n"\ +" extreme: VBR encoding, very high quality\n"\ +" (200-240 kbps bitrate range)\n"\ +" insane: CBR encoding, highest preset quality\n"\ +" (320 kbps bitrate)\n"\ +" <8-320>: ABR encoding at average given kbps bitrate.\n\n") + + m_option_t lameopts_conf[]={ {"q", &lame_param_quality, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL}, @@ -64,18 +113,18 @@ m_option_t lameopts_conf[]={ {"fast", "MPlayer was built without -lameopts fast support (requires libmp3lame >=3.92).\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, {"preset", "MPlayer was built without -lameopts preset support (requires libmp3lame >=3.92).\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif - {"help", _(MSGTR_MEncoderMP3LameHelp), CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"help", MEncoderMP3LameHelp, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; static int bind_lame(audio_encoder_t *encoder, muxer_stream_t *mux_a) { - mp_tmsg(MSGT_MENCODER, MSGL_INFO, MSGTR_MP3AudioSelected); + mp_tmsg(MSGT_MENCODER, MSGL_INFO, "MP3 audio selected.\n"); mux_a->h.dwSampleSize=0; // VBR mux_a->h.dwRate=encoder->params.sample_rate; mux_a->h.dwScale=encoder->params.samples_per_frame; // samples/frame - if(sizeof(MPEGLAYER3WAVEFORMAT)!=30) mp_tmsg(MSGT_MENCODER,MSGL_WARN,MSGTR_MP3WaveFormatSizeNot30,sizeof(MPEGLAYER3WAVEFORMAT)); + if(sizeof(MPEGLAYER3WAVEFORMAT)!=30) mp_tmsg(MSGT_MENCODER,MSGL_WARN,"sizeof(MPEGLAYER3WAVEFORMAT)==%d!=30, maybe broken C compiler?\n",sizeof(MPEGLAYER3WAVEFORMAT)); mux_a->wf=malloc(sizeof(MPEGLAYER3WAVEFORMAT)); // should be 30 mux_a->wf->wFormatTag=0x55; // MP3 mux_a->wf->nChannels= (lame_param_mode<0) ? encoder->params.channels : ((lame_param_mode==3) ? 1 : 2); @@ -143,7 +192,7 @@ static void fixup(audio_encoder_t *encoder) encoder->stream->h.dwRate=encoder->stream->wf->nAvgBytesPerSec; encoder->stream->h.dwScale=1; encoder->stream->wf->nBlockAlign=1; - mp_tmsg(MSGT_MENCODER, MSGL_V, MSGTR_CBRAudioByterate, + mp_tmsg(MSGT_MENCODER, MSGL_V, "\n\nCBR audio: %d bytes/sec, %d bytes/block\n", encoder->stream->h.dwRate,((MPEGLAYER3WAVEFORMAT*)(encoder->stream->wf))->nBlockSize); } } @@ -174,20 +223,23 @@ int mpae_init_lame(audio_encoder_t *encoder) if(lame_param_mode>=0) lame_set_mode(lame,lame_param_mode); // j-st if(lame_param_ratio>0) lame_set_compression_ratio(lame,lame_param_ratio); if(lame_param_scale>0) { - mp_tmsg(MSGT_MENCODER, MSGL_V, MSGTR_SettingAudioInputGain, lame_param_scale); + mp_tmsg(MSGT_MENCODER, MSGL_V, "Setting audio input gain to %f.\n", lame_param_scale); lame_set_scale(lame,lame_param_scale); } if(lame_param_lowpassfreq>=-1) lame_set_lowpassfreq(lame,lame_param_lowpassfreq); if(lame_param_highpassfreq>=-1) lame_set_highpassfreq(lame,lame_param_highpassfreq); #ifdef CONFIG_MP3LAME_PRESET if(lame_param_preset != NULL) { - mp_tmsg(MSGT_MENCODER, MSGL_V, MSGTR_LamePresetEquals,lame_param_preset); + mp_tmsg(MSGT_MENCODER, MSGL_V, "\npreset=%s\n\n",lame_param_preset); if(lame_presets_set(lame,lame_param_fast, (lame_param_vbr==0), lame_param_preset) < 0) return 0; } #endif if(lame_init_params(lame) == -1) { - mp_tmsg(MSGT_MENCODER, MSGL_FATAL, MSGTR_LameCantInit); + mp_tmsg(MSGT_MENCODER, MSGL_FATAL, + "Cannot set LAME options, check bitrate/samplerate, some very low bitrates\n"\ + "(<32) need lower samplerates (i.e. -srate 8000).\n"\ + "If everything else fails, try a preset."); return 0; } if( mp_msg_test(MSGT_MENCODER,MSGL_V) ) { @@ -211,8 +263,87 @@ static int lame_presets_set( lame_t gfp, int fast, int cbr, const char* preset_ int mono = 0; if (strcmp(preset_name, "help") == 0) { - mp_tmsg(MSGT_MENCODER, MSGL_FATAL, MSGTR_LameVersion, get_lame_version(), get_lame_url()); - mp_tmsg(MSGT_MENCODER, MSGL_FATAL, MSGTR_LamePresetsLongInfo); + mp_tmsg(MSGT_MENCODER, MSGL_FATAL, "LAME version %s (%s)\n\n", get_lame_version(), get_lame_url()); + +#define LamePresetsLongInfo _("\n"\ +"The preset switches are designed to provide the highest possible quality.\n"\ +"\n"\ +"They have for the most part been subjected to and tuned via rigorous double\n"\ +"blind listening tests to verify and achieve this objective.\n"\ +"\n"\ +"These are continually updated to coincide with the latest developments that\n"\ +"occur and as a result should provide you with nearly the best quality\n"\ +"currently possible from LAME.\n"\ +"\n"\ +"To activate these presets:\n"\ +"\n"\ +" For VBR modes (generally highest quality):\n"\ +"\n"\ +" \"preset=standard\" This preset should generally be transparent\n"\ +" to most people on most music and is already\n"\ +" quite high in quality.\n"\ +"\n"\ +" \"preset=extreme\" If you have extremely good hearing and similar\n"\ +" equipment, this preset will generally provide\n"\ +" slightly higher quality than the \"standard\"\n"\ +" mode.\n"\ +"\n"\ +" For CBR 320kbps (highest quality possible from the preset switches):\n"\ +"\n"\ +" \"preset=insane\" This preset will usually be overkill for most\n"\ +" people and most situations, but if you must\n"\ +" have the absolute highest quality with no\n"\ +" regard to filesize, this is the way to go.\n"\ +"\n"\ +" For ABR modes (high quality per given bitrate but not as high as VBR):\n"\ +"\n"\ +" \"preset=<kbps>\" Using this preset will usually give you good\n"\ +" quality at a specified bitrate. Depending on the\n"\ +" bitrate entered, this preset will determine the\n"\ +" optimal settings for that particular situation.\n"\ +" While this approach works, it is not nearly as\n"\ +" flexible as VBR, and usually will not attain the\n"\ +" same level of quality as VBR at higher bitrates.\n"\ +"\n"\ +"The following options are also available for the corresponding profiles:\n"\ +"\n"\ +" <fast> standard\n"\ +" <fast> extreme\n"\ +" insane\n"\ +" <cbr> (ABR Mode) - The ABR Mode is implied. To use it,\n"\ +" simply specify a bitrate. For example:\n"\ +" \"preset=185\" activates this\n"\ +" preset and uses 185 as an average kbps.\n"\ +"\n"\ +" \"fast\" - Enables the new fast VBR for a particular profile. The\n"\ +" disadvantage to the speed switch is that often times the\n"\ +" bitrate will be slightly higher than with the normal mode\n"\ +" and quality may be slightly lower also.\n"\ +" Warning: with the current version fast presets might result in too\n"\ +" high bitrate compared to regular presets.\n"\ +"\n"\ +" \"cbr\" - If you use the ABR mode (read above) with a significant\n"\ +" bitrate such as 80, 96, 112, 128, 160, 192, 224, 256, 320,\n"\ +" you can use the \"cbr\" option to force CBR mode encoding\n"\ +" instead of the standard abr mode. ABR does provide higher\n"\ +" quality but CBR may be useful in situations such as when\n"\ +" streaming an MP3 over the internet may be important.\n"\ +"\n"\ +" For example:\n"\ +"\n"\ +" \"-lameopts fast:preset=standard \"\n"\ +" or \"-lameopts cbr:preset=192 \"\n"\ +" or \"-lameopts preset=172 \"\n"\ +" or \"-lameopts preset=extreme \"\n"\ +"\n"\ +"\n"\ +"A few aliases are available for ABR mode:\n"\ +"phone => 16kbps/mono phon+/lw/mw-eu/sw => 24kbps/mono\n"\ +"mw-us => 40kbps/mono voice => 56kbps/mono\n"\ +"fm/radio/tape => 112kbps hifi => 160kbps\n"\ +"cd => 192kbps studio => 256kbps") + + mp_tmsg(MSGT_MENCODER, MSGL_FATAL, LamePresetsLongInfo); return -1; } @@ -307,14 +438,39 @@ static int lame_presets_set( lame_t gfp, int fast, int cbr, const char* preset_ } else { - mp_tmsg(MSGT_MENCODER, MSGL_FATAL, MSGTR_LameVersion, get_lame_version(), get_lame_url()); - mp_tmsg(MSGT_MENCODER, MSGL_FATAL, MSGTR_InvalidBitrateForLamePreset); + mp_tmsg(MSGT_MENCODER, MSGL_FATAL, "LAME version %s (%s)\n\n", get_lame_version(), get_lame_url()); + mp_tmsg(MSGT_MENCODER, MSGL_FATAL, + "Error: The bitrate specified is out of the valid range for this preset.\n"\ + "\n"\ + "When using this mode you must enter a value between \"8\" and \"320\".\n"\ + "\n"\ + "For further information try: \"-lameopts preset=help\"\n"); return -1; } } - mp_tmsg(MSGT_MENCODER, MSGL_FATAL, MSGTR_LameVersion, get_lame_version(), get_lame_url()); - mp_tmsg(MSGT_MENCODER, MSGL_FATAL, MSGTR_InvalidLamePresetOptions); + mp_tmsg(MSGT_MENCODER, MSGL_FATAL, "LAME version %s (%s)\n\n", get_lame_version(), get_lame_url()); +#define InvalidLamePresetOptions _("Error: You did not enter a valid profile and/or options with preset.\n"\ +"\n"\ +"Available profiles are:\n"\ +"\n"\ +" <fast> standard\n"\ +" <fast> extreme\n"\ +" insane\n"\ +" <cbr> (ABR Mode) - The ABR Mode is implied. To use it,\n"\ +" simply specify a bitrate. For example:\n"\ +" \"preset=185\" activates this\n"\ +" preset and uses 185 as an average kbps.\n"\ +"\n"\ +" Some examples:\n"\ +"\n"\ +" \"-lameopts fast:preset=standard \"\n"\ +" or \"-lameopts cbr:preset=192 \"\n"\ +" or \"-lameopts preset=172 \"\n"\ +" or \"-lameopts preset=extreme \"\n"\ +"\n"\ +"For further information try: \"-lameopts preset=help\"\n") + mp_tmsg(MSGT_MENCODER, MSGL_FATAL, InvalidLamePresetOptions); return -1; } #endif diff --git a/libmpcodecs/ae_lavc.c b/libmpcodecs/ae_lavc.c index cd46fdb71c..57f3c29a50 100644 --- a/libmpcodecs/ae_lavc.c +++ b/libmpcodecs/ae_lavc.c @@ -166,7 +166,7 @@ int mpae_init_lavc(audio_encoder_t *encoder) if(!lavc_param_acodec) { - mp_tmsg(MSGT_MENCODER, MSGL_FATAL, MSGTR_NoLavcAudioCodecName); + mp_tmsg(MSGT_MENCODER, MSGL_FATAL, "Audio LAVC, Missing codec name!\n"); return 0; } @@ -179,7 +179,7 @@ int mpae_init_lavc(audio_encoder_t *encoder) lavc_acodec = avcodec_find_encoder_by_name(lavc_param_acodec); if (!lavc_acodec) { - mp_tmsg(MSGT_MENCODER, MSGL_FATAL, MSGTR_LavcAudioCodecNotFound, lavc_param_acodec); + mp_tmsg(MSGT_MENCODER, MSGL_FATAL, "Audio LAVC, couldn't find encoder for codec %s.\n", lavc_param_acodec); return 0; } if(lavc_param_atag == 0) @@ -199,7 +199,7 @@ int mpae_init_lavc(audio_encoder_t *encoder) lavc_actx = avcodec_alloc_context(); if(lavc_actx == NULL) { - mp_tmsg(MSGT_MENCODER, MSGL_FATAL, MSGTR_CouldntAllocateLavcContext); + mp_tmsg(MSGT_MENCODER, MSGL_FATAL, "Audio LAVC, couldn't allocate context!\n"); return 0; } @@ -238,7 +238,7 @@ int mpae_init_lavc(audio_encoder_t *encoder) if(avcodec_open(lavc_actx, lavc_acodec) < 0) { - mp_tmsg(MSGT_MENCODER, MSGL_FATAL, MSGTR_CouldntOpenCodec, lavc_param_acodec, lavc_param_abitrate); + mp_tmsg(MSGT_MENCODER, MSGL_FATAL, "Couldn't open codec %s, br=%d.\n", lavc_param_acodec, lavc_param_abitrate); return 0; } diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c index 5525610ca2..78dddbf05f 100644 --- a/libmpcodecs/dec_audio.c +++ b/libmpcodecs/dec_audio.c @@ -34,7 +34,7 @@ af_cfg_t af_cfg = { 1, NULL }; // Configuration for audio filters void afm_help(void) { int i; - mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, MSGTR_AvailableAudioFm); + mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, "Available (compiled-in) audio codec families/drivers:\n"); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_DRIVERS\n"); mp_msg(MSGT_DECAUDIO, MSGL_INFO, " afm: info: (comment)\n"); for (i = 0; mpcodecs_ad_drivers[i] != NULL; i++) @@ -61,14 +61,14 @@ static int init_audio_codec(sh_audio_t *sh_audio) } } if (!sh_audio->ad_driver->preinit(sh_audio)) { - mp_tmsg(MSGT_DECAUDIO, MSGL_ERR, MSGTR_ADecoderPreinitFailed); + mp_tmsg(MSGT_DECAUDIO, MSGL_ERR, "ADecoder preinit failed :(\n"); return 0; } /* allocate audio in buffer: */ if (sh_audio->audio_in_minsize > 0) { sh_audio->a_in_buffer_size = sh_audio->audio_in_minsize; - mp_tmsg(MSGT_DECAUDIO, MSGL_V, MSGTR_AllocatingBytesForInputBuffer, + mp_tmsg(MSGT_DECAUDIO, MSGL_V, "dec_audio: Allocating %d bytes for input buffer.\n", sh_audio->a_in_buffer_size); sh_audio->a_in_buffer = av_mallocz(sh_audio->a_in_buffer_size); sh_audio->a_in_buffer_len = 0; @@ -76,18 +76,18 @@ static int init_audio_codec(sh_audio_t *sh_audio) sh_audio->a_buffer_size = sh_audio->audio_out_minsize + MAX_OUTBURST; - mp_tmsg(MSGT_DECAUDIO, MSGL_V, MSGTR_AllocatingBytesForOutputBuffer, + mp_tmsg(MSGT_DECAUDIO, MSGL_V, "dec_audio: Allocating %d + %d = %d bytes for output buffer.\n", sh_audio->audio_out_minsize, MAX_OUTBURST, sh_audio->a_buffer_size); sh_audio->a_buffer = av_mallocz(sh_audio->a_buffer_size); if (!sh_audio->a_buffer) { - mp_tmsg(MSGT_DECAUDIO, MSGL_ERR, MSGTR_CantAllocAudioBuf); + mp_tmsg(MSGT_DECAUDIO, MSGL_ERR, "Cannot allocate audio out buffer.\n"); return 0; } sh_audio->a_buffer_len = 0; if (!sh_audio->ad_driver->init(sh_audio)) { - mp_tmsg(MSGT_DECAUDIO, MSGL_WARN, MSGTR_ADecoderInitFailed); + mp_tmsg(MSGT_DECAUDIO, MSGL_WARN, "ADecoder init failed :(\n"); uninit_audio(sh_audio); // free buffers return 0; } @@ -95,7 +95,7 @@ static int init_audio_codec(sh_audio_t *sh_audio) sh_audio->initialized = 1; if (!sh_audio->channels || !sh_audio->samplerate) { - mp_tmsg(MSGT_DECAUDIO, MSGL_WARN, MSGTR_UnknownAudio); + mp_tmsg(MSGT_DECAUDIO, MSGL_WARN, "Unknown/missing audio format -> no sound\n"); uninit_audio(sh_audio); // free buffers return 0; } @@ -199,17 +199,17 @@ static int init_audio(sh_audio_t *sh_audio, char *codecname, char *afm, #endif if (!mpadec) { // driver not available (==compiled in) mp_tmsg(MSGT_DECAUDIO, MSGL_ERR, - MSGTR_AudioCodecFamilyNotAvailableStr, + "Requested audio codec family [%s] (afm=%s) not available.\nEnable it at compilation.\n", sh_audio->codec->name, sh_audio->codec->drv); continue; } // it's available, let's try to init! // init() - mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, MSGTR_OpeningAudioDecoder, + mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, "Opening audio decoder: [%s] %s\n", mpadec->info->short_name, mpadec->info->name); sh_audio->ad_driver = mpadec; if (!init_audio_codec(sh_audio)) { - mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, MSGTR_ADecoderInitFailed); + mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, "ADecoder init failed :(\n"); continue; // try next... } // Yeah! We got it! @@ -237,7 +237,7 @@ int init_best_audio_codec(sh_audio_t *sh_audio, char **audio_codec_list, stringset_add(&selected, audio_codec + 1); } else { // forced codec by name: - mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, MSGTR_ForcedAudioCodec, + mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, "Forced audio codec: %s\n", audio_codec); init_audio(sh_audio, audio_codec, NULL, -1, &selected); } @@ -250,7 +250,7 @@ int init_best_audio_codec(sh_audio_t *sh_audio, char **audio_codec_list, // try first the preferred codec families: while (!sh_audio->initialized && *fmlist) { char *audio_fm = *(fmlist++); - mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, MSGTR_TryForceAudioFmtStr, + mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, "Trying to force audio codec driver family %s...\n", audio_fm); for (status = CODECS_STATUS__MAX; status >= CODECS_STATUS__MIN; --status) @@ -268,12 +268,12 @@ int init_best_audio_codec(sh_audio_t *sh_audio, char **audio_codec_list, stringset_free(&selected); if (!sh_audio->initialized) { - mp_tmsg(MSGT_DECAUDIO, MSGL_ERR, MSGTR_CantFindAudioCodec, + mp_tmsg(MSGT_DECAUDIO, MSGL_ERR, "Cannot find codec for audio format 0x%X.\n", sh_audio->format); return 0; // failed } - mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, MSGTR_SelectedAudioCodec, + mp_tmsg(MSGT_DECAUDIO, MSGL_INFO, "Selected audio codec: [%s] afm: %s (%s)\n", sh_audio->codec->name, sh_audio->codec->drv, sh_audio->codec->info); return 1; // success } @@ -287,7 +287,7 @@ void uninit_audio(sh_audio_t *sh_audio) sh_audio->afilter = NULL; } if (sh_audio->initialized) { - mp_tmsg(MSGT_DECAUDIO, MSGL_V, MSGTR_UninitAudioStr, + mp_tmsg(MSGT_DECAUDIO, MSGL_V, "Uninit audio: %s\n", sh_audio->codec->drv); sh_audio->ad_driver->uninit(sh_audio); #ifdef CONFIG_DYNAMIC_PLUGINS @@ -327,7 +327,7 @@ int init_audio_filters(sh_audio_t *sh_audio, int in_samplerate, // filter config: memcpy(&afs->cfg, &af_cfg, sizeof(af_cfg_t)); - mp_tmsg(MSGT_DECAUDIO, MSGL_V, MSGTR_BuildingAudioFilterChain, + mp_tmsg(MSGT_DECAUDIO, MSGL_V, "Building audio filter chain for %dHz/%dch/%s -> %dHz/%dch/%s...\n", afs->input.rate, afs->input.nch, af_fmt2str_short(afs->input.format), afs->output.rate, afs->output.nch, af_fmt2str_short(afs->output.format)); diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index 23a47992f3..0a258fabcb 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -47,7 +47,7 @@ int get_video_quality_max(sh_video_t *sh_video) if (vf) { int ret = vf->control(vf, VFCTRL_QUERY_MAX_PP_LEVEL, NULL); if (ret > 0) { - mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_UsingExternalPP, ret); + mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, "[PP] Using external postprocessing filter, max q = %d.\n", ret); return ret; } } @@ -55,7 +55,7 @@ int get_video_quality_max(sh_video_t *sh_video) if (vd) { int ret = vd->control(sh_video, VDCTRL_QUERY_MAX_PP_LEVEL, NULL); if (ret > 0) { - mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_UsingCodecPP, ret); + mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, "[PP] Using codec's postprocessing, max q = %d.\n", ret); return ret; } } @@ -95,7 +95,7 @@ int set_video_colors(sh_video_t *sh_video, const char *item, int value) vd->control(sh_video, VDCTRL_SET_EQUALIZER, item, (int *) value) == CONTROL_OK) return 1; - mp_tmsg(MSGT_DECVIDEO, MSGL_V, MSGTR_VideoAttributeNotSupportedByVO_VD, + mp_tmsg(MSGT_DECVIDEO, MSGL_V, "Video attribute '%s' is not supported by selected vo & vd.\n", item); return 0; } @@ -166,7 +166,7 @@ void uninit_video(sh_video_t *sh_video) { if (!sh_video->initialized) return; - mp_tmsg(MSGT_DECVIDEO, MSGL_V, MSGTR_UninitVideoStr, sh_video->codec->drv); + mp_tmsg(MSGT_DECVIDEO, MSGL_V, "Uninit video: %s\n", sh_video->codec->drv); sh_video->vd_driver->uninit(sh_video); #ifdef CONFIG_DYNAMIC_PLUGINS if (sh_video->dec_handle) @@ -179,7 +179,7 @@ void uninit_video(sh_video_t *sh_video) void vfm_help(void) { int i; - mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_AvailableVideoFm); + mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, "Available (compiled-in) video codec families/drivers:\n"); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_DRIVERS\n"); mp_msg(MSGT_DECVIDEO, MSGL_INFO, " vfm: info: (comment)\n"); for (i = 0; mpcodecs_vd_drivers[i] != NULL; i++) @@ -269,7 +269,7 @@ static int init_video(sh_video_t *sh_video, char *codecname, char *vfm, #endif if (!sh_video->vd_driver) { // driver not available (==compiled in) mp_tmsg(MSGT_DECVIDEO, MSGL_WARN, - _(MSGTR_VideoCodecFamilyNotAvailableStr), + _("Requested video codec family [%s] (vfm=%s) not available.\nEnable it at compilation.\n"), sh_video->codec->name, sh_video->codec->drv); continue; } @@ -290,13 +290,13 @@ static int init_video(sh_video_t *sh_video, char *codecname, char *vfm, // init() const struct vd_functions *vd = sh_video->vd_driver; - mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_OpeningVideoDecoder, + mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, "Opening video decoder: [%s] %s\n", vd->info->short_name, vd->info->name); // clear vf init error, it is no longer relevant if (sh_video->vf_initialized < 0) sh_video->vf_initialized = 0; if (!vd->init(sh_video)) { - mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_VDecoderInitFailed); + mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, "VDecoder init failed :(\n"); sh_video->disp_w = orig_w; sh_video->disp_h = orig_h; if (sh_video->bih) { @@ -331,7 +331,7 @@ int init_best_video_codec(sh_video_t *sh_video, char **video_codec_list, stringset_add(&selected, video_codec + 1); } else { // forced codec by name: - mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_ForcedVideoCodec, + mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, "Forced video codec: %s\n", video_codec); init_video(sh_video, video_codec, NULL, -1, &selected); } @@ -343,7 +343,7 @@ int init_best_video_codec(sh_video_t *sh_video, char **video_codec_list, // try first the preferred codec families: while (!sh_video->initialized && *fmlist) { char *video_fm = *(fmlist++); - mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_TryForceVideoFmtStr, + mp_tmsg(MSGT_DECVIDEO, MSGL_INFO, "Trying to force video codec driver family %s...\n", video_fm); for (status = CODECS_STATUS__MAX; status >= CODECS_STATUS__MIN; --status) @@ -362,12 +362,12 @@ int init_best_video_codec(sh_video_t *sh_video, char **video_codec_list, |