X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Ftwolame.c;h=8fc52b10ca2093420dbeb8d3cee8d8c1da45cddf;hb=c5e9eb52b9ab32d978f6911886e2a7b1cdc27672;hp=42d90f0dc5f496547b18ad452452403ddc8cd901;hpb=62e5a2bc1990e1257442d5900251de91bd3a1906;p=vlc diff --git a/modules/codec/twolame.c b/modules/codec/twolame.c index 42d90f0dc5..8fc52b10ca 100644 --- a/modules/codec/twolame.c +++ b/modules/codec/twolame.c @@ -19,16 +19,16 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /***************************************************************************** * Preamble *****************************************************************************/ #include -#include -#include -#include +#include +#include +#include #include @@ -49,19 +49,23 @@ static block_t *Encode ( encoder_t *, aout_buffer_t * ); #define ENC_QUALITY_TEXT N_("Encoding quality") #define ENC_QUALITY_LONGTEXT N_( \ - "Allows you to specify a quality between 0.0 (high) and 50.0 (low), " \ + "Force a specific encoding quality between 0.0 (high) and 50.0 (low), " \ "instead of specifying a particular bitrate. " \ "This will produce a VBR stream." ) #define ENC_MODE_TEXT N_("Stereo mode") -#define ENC_MODE_LONGTEXT N_( \ - "[0=stereo, 1=dual-mono, 2=joint-stereo]" ) +#define ENC_MODE_LONGTEXT N_( "Handling mode for stereo streams" ) #define ENC_VBR_TEXT N_("VBR mode") #define ENC_VBR_LONGTEXT N_( \ - "By default the encoding is CBR." ) + "Use Variable BitRate. Default is to use Constant BitRate (CBR)." ) #define ENC_PSY_TEXT N_("Psycho-acoustic model") #define ENC_PSY_LONGTEXT N_( \ "Integer from -1 (no model) to 4." ) +static int pi_stereo_values[] = { 0, 1, 2 }; +static char *ppsz_stereo_descriptions[] = +{ N_("Stereo"), N_("Dual mono"), N_("Joint stereo") }; + + vlc_module_begin(); set_shortname( "Twolame"); set_description( _("Libtwolame audio encoder") ); @@ -74,6 +78,7 @@ vlc_module_begin(); ENC_QUALITY_LONGTEXT, VLC_FALSE ); add_integer( ENC_CFG_PREFIX "mode", 0, NULL, ENC_MODE_TEXT, ENC_MODE_LONGTEXT, VLC_FALSE ); + change_integer_list( pi_stereo_values, ppsz_stereo_descriptions, 0 ); add_bool( ENC_CFG_PREFIX "vbr", 0, NULL, ENC_VBR_TEXT, ENC_VBR_LONGTEXT, VLC_FALSE ); add_integer( ENC_CFG_PREFIX "psy", 3, NULL, ENC_PSY_TEXT, @@ -160,7 +165,7 @@ static int OpenEncoder( vlc_object_t *p_this ) p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE; p_enc->fmt_out.i_codec = VLC_FOURCC('m','p','g','a'); - sout_CfgParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg ); + config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg ); p_sys->p_twolame = twolame_init(); @@ -280,7 +285,7 @@ static block_t *Encode( encoder_t *p_enc, aout_buffer_t *p_aout_buf ) p_sys->p_out_buffer, MAX_CODED_FRAME_SIZE ); p_sys->i_nb_samples = 0; p_block = block_New( p_enc, i_used ); - p_enc->p_vlc->pf_memcpy( p_block->p_buffer, p_sys->p_out_buffer, + p_enc->p_libvlc->pf_memcpy( p_block->p_buffer, p_sys->p_out_buffer, i_used ); p_block->i_length = (mtime_t)1000000 * (mtime_t)MPEG_FRAME_SIZE / (mtime_t)p_enc->fmt_out.audio.i_rate;