+ module_config_t *p_config;
+ int i;
+
+ p_config = config_FindConfig( VLC_OBJECT(p_aout), "audio-replay-gain-mode" );
+ if( p_config && p_config->i_list )
+ {
+ var_Create( p_aout, "audio-replay-gain-mode",
+ VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+
+ text.psz_string = _("Replay gain");
+ var_Change( p_aout, "audio-replay-gain-mode", VLC_VAR_SETTEXT, &text, NULL );
+
+ for( i = 0; i < p_config->i_list; i++ )
+ {
+ val.psz_string = (char *)p_config->ppsz_list[i];
+ text.psz_string = (char *)p_config->ppsz_list_text[i];
+ var_Change( p_aout, "audio-replay-gain-mode", VLC_VAR_ADDCHOICE,
+ &val, &text );
+ }
+
+ var_AddCallback( p_aout, "audio-replay-gain-mode", ReplayGainCallback, NULL );
+ }
+ }
+ if( var_Type( p_aout, "audio-replay-gain-preamp" ) == 0 )
+ {
+ var_Create( p_aout, "audio-replay-gain-preamp",
+ VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
+ }
+ if( var_Type( p_aout, "audio-replay-gain-default" ) == 0 )
+ {
+ var_Create( p_aout, "audio-replay-gain-default",
+ VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
+ }
+ if( var_Type( p_aout, "audio-replay-gain-peak-protection" ) == 0 )
+ {
+ var_Create( p_aout, "audio-replay-gain-peak-protection",
+ 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 );
+ }
+
+ psz_filters = var_GetString( p_aout, "audio-filter" );
+ psz_visual = var_GetString( p_aout, "audio-visual");
+ psz_scaletempo = var_GetBool( p_aout, "audio-time-stretch" ) ? strdup( "scaletempo" ) : NULL;
+
+ p_input->b_recycle_vout = psz_visual && *psz_visual;
+
+ /* parse user filter lists */
+ char *const ppsz_array[] = { psz_scaletempo, psz_filters, psz_visual };
+ p_input->p_playback_rate_filter = NULL;
+
+ for( i_visual = 0; i_visual < 3 && !AOUT_FMT_NON_LINEAR(&chain_output_format); i_visual++ )
+ {
+ char *psz_next = NULL;
+ char *psz_parser = ppsz_array[i_visual];
+
+ if( psz_parser == NULL || !*psz_parser )
+ continue;