Commit eff24974 authored by Laurent Aimar's avatar Laurent Aimar

Added new audio-time-strech option to insert scaletempo by default.

parent e740751b
...@@ -70,7 +70,7 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input ) ...@@ -70,7 +70,7 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
audio_sample_format_t chain_input_format; audio_sample_format_t chain_input_format;
audio_sample_format_t chain_output_format; audio_sample_format_t chain_output_format;
vlc_value_t val, text; vlc_value_t val, text;
char * psz_filters, *psz_visual; char *psz_filters, *psz_visual, *psz_scaletempo;
int i_visual; int i_visual;
aout_FormatPrint( p_aout, "input", &p_input->input ); aout_FormatPrint( p_aout, "input", &p_input->input );
...@@ -211,17 +211,25 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input ) ...@@ -211,17 +211,25 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
var_Create( p_aout, "audio-replay-gain-peak-protection", var_Create( p_aout, "audio-replay-gain-peak-protection",
VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
} }
if( var_Type( p_aout, "audio-time-stretch" ) == 0 )
{
var_Create( p_aout, "audio-time-stretch",
VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
}
var_Get( p_aout, "audio-filter", &val ); var_Get( p_aout, "audio-filter", &val );
psz_filters = val.psz_string; psz_filters = val.psz_string;
var_Get( p_aout, "audio-visual", &val ); var_Get( p_aout, "audio-visual", &val );
psz_visual = val.psz_string; psz_visual = val.psz_string;
psz_scaletempo = var_GetBool( p_aout, "audio-time-stretch" ) ? strdup( "scaletempo" ) : NULL;
/* parse user filter lists */ /* parse user filter lists */
for( i_visual = 0; i_visual < 2; i_visual++ ) for( i_visual = 0; i_visual < 2; i_visual++ )
{ {
char *ppsz_array[] = { psz_scaletempo, psz_filters, psz_visual };
char *psz_next = NULL; char *psz_next = NULL;
char *psz_parser = i_visual ? psz_visual : psz_filters; char *psz_parser = ppsz_array[i_visual];
if( psz_parser == NULL || !*psz_parser ) if( psz_parser == NULL || !*psz_parser )
continue; continue;
...@@ -264,7 +272,7 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input ) ...@@ -264,7 +272,7 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
vlc_object_attach( p_filter , p_aout ); vlc_object_attach( p_filter , p_aout );
/* try to find the requested filter */ /* try to find the requested filter */
if( i_visual == 1 ) /* this can only be a visualization module */ if( i_visual == 2 ) /* this can only be a visualization module */
{ {
/* request format */ /* request format */
memcpy( &p_filter->input, &chain_output_format, memcpy( &p_filter->input, &chain_output_format,
...@@ -357,8 +365,9 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input ) ...@@ -357,8 +365,9 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
psz_parser = psz_next; psz_parser = psz_next;
} }
} }
free( psz_filters );
free( psz_visual ); free( psz_visual );
free( psz_filters );
free( psz_scaletempo );
/* complete the filter chain if necessary */ /* complete the filter chain if necessary */
if ( !AOUT_FMTS_IDENTICAL( &chain_input_format, &chain_output_format ) ) if ( !AOUT_FMTS_IDENTICAL( &chain_input_format, &chain_output_format ) )
......
...@@ -313,6 +313,13 @@ static const char *const ppsz_force_dolby_descriptions[] = { ...@@ -313,6 +313,13 @@ static const char *const ppsz_force_dolby_descriptions[] = {
#define AUDIO_REPLAY_GAIN_PEAK_PROTECTION_LONGTEXT N_( \ #define AUDIO_REPLAY_GAIN_PEAK_PROTECTION_LONGTEXT N_( \
"Protect against sound clipping" ) "Protect against sound clipping" )
#define AUDIO_TIME_STRETCH_TEXT N_( \
"Enable time streching audio" )
#define AUDIO_TIME_STRETCH_LONGTEXT N_( \
"This allows to play audio at lower or higher speed without" \
"affecting the audio pitch" )
static const char *const ppsz_replay_gain_mode[] = { static const char *const ppsz_replay_gain_mode[] = {
"none", "track", "album" }; "none", "track", "album" };
static const char *const ppsz_replay_gain_mode_text[] = { static const char *const ppsz_replay_gain_mode_text[] = {
...@@ -1463,6 +1470,9 @@ vlc_module_begin(); ...@@ -1463,6 +1470,9 @@ vlc_module_begin();
add_bool( "audio-replay-gain-peak-protection", true, NULL, add_bool( "audio-replay-gain-peak-protection", true, NULL,
AUDIO_REPLAY_GAIN_PEAK_PROTECTION_TEXT, AUDIO_REPLAY_GAIN_PEAK_PROTECTION_LONGTEXT, true ); AUDIO_REPLAY_GAIN_PEAK_PROTECTION_TEXT, AUDIO_REPLAY_GAIN_PEAK_PROTECTION_LONGTEXT, true );
add_bool( "audio-time-stretch", true, NULL,
AUDIO_TIME_STRETCH_TEXT, AUDIO_TIME_STRETCH_LONGTEXT, false );
set_subcategory( SUBCAT_AUDIO_AOUT ); set_subcategory( SUBCAT_AUDIO_AOUT );
add_module( "aout", "audio output", NULL, NULL, AOUT_TEXT, AOUT_LONGTEXT, add_module( "aout", "audio output", NULL, NULL, AOUT_TEXT, AOUT_LONGTEXT,
true ); true );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment