changeset 14762:b2cb91b9b4e0

fix missing check against lame_init_params that was leading to video only files on low (under 32) audio bitrates
author reynaldo
date Tue, 22 Feb 2005 15:13:28 +0000
parents f6284dd2516e
children 2c4e30f37773
files help/help_mp-en.h help/help_mp-es.h mencoder.c
diffstat 3 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/help/help_mp-en.h	Tue Feb 22 14:40:44 2005 +0000
+++ b/help/help_mp-en.h	Tue Feb 22 15:13:28 2005 +0000
@@ -337,6 +337,9 @@
 "mw-us => 40kbps/mono        voice => 56kbps/mono\n"\
 "fm/radio/tape => 112kbps    hifi => 160kbps\n"\
 "cd => 192kbps               studio => 256kbps"
+#define MSGTR_LameCantInit "can't set Lame options, check bitrate/samplerate,"\
+" some very low bitrates (<32) need lower samplerates (i.e. -srate 8000). "\
+"if everything else fails, try a preset."
 #define MSGTR_ConfigfileError "configfile error"
 #define MSGTR_ErrorParsingCommandLine "error parsing cmdline"
 #define MSGTR_VideoStreamRequired "Video stream is mandatory!\n"
--- a/help/help_mp-es.h	Tue Feb 22 14:40:44 2005 +0000
+++ b/help/help_mp-es.h	Tue Feb 22 15:13:28 2005 +0000
@@ -308,6 +308,9 @@
 "mw-us => 40kbps/mono        voice => 56kbps/mono\n"\
 "fm/radio/tape => 112kbps    hifi => 160kbps\n"\
 "cd => 192kbps               studio => 256kbps"
+#define MSGTR_LameCantInit "No se pudo setear las opciones de Lame, revise el"\
+" bitrate/samplerate, algunos bitrates muy bajos (<32) necesitan una tasa de"\
+" muestreo más baja (ej. -srate 8000). Si todo falla, pruebe con un preset."
 #define MSGTR_ConfigfileError "error en archivo de configuración"
 #define MSGTR_ErrorParsingCommandLine "error en parametros de la línea de comando"
 #define MSGTR_VideoStreamRequired "ˇEl flujo de video es obligatorio!\n"
--- a/mencoder.c	Tue Feb 22 14:40:44 2005 +0000
+++ b/mencoder.c	Tue Feb 22 15:13:28 2005 +0000
@@ -1110,7 +1110,10 @@
   lame_presets_set(lame,lame_param_fast, (lame_param_vbr==0), lame_param_preset);
 }
 #endif
-lame_init_params(lame);
+if(lame_init_params(lame) == -1){
+    mp_msg(MSGT_MENCODER, MSGL_FATAL, MSGTR_LameCantInit); 
+    mencoder_exit(1,NULL);
+}
 if(verbose>0){
     lame_print_config(lame);
     lame_print_internals(lame);