- int i_nb_conversions = SplitConversion( p_aout, p_input_format,
- p_output_format, &temp_format,
- b_format_first, b_rate_first );
+ /* Try with only one conversion. */
+ SplitConversion( p_input_format, &temp_format, &temp_format );
+ pp_filters[0] = FindFilter( p_aout, p_input_format, &temp_format );
+ }
+ if ( pp_filters[0] == NULL )
+ {
+ msg_Err( p_aout,
+ "couldn't find a filter for the first part of the conversion" );
+ return -1;
+ }
+
+ /* We have the first stage of the conversion. Find a filter for
+ * the rest. */
+ if( *pi_nb_filters + 2 > AOUT_MAX_FILTERS )
+ {
+ ReleaseFilter( pp_filters[0] );
+ msg_Err( p_aout, "max filter reached (%d)", AOUT_MAX_FILTERS );
+ dialog_Fatal( p_aout, _("Audio filtering failed"),
+ _("The maximum number of filters (%d) was reached."),
+ AOUT_MAX_FILTERS );
+ return -1;
+ }
+ pp_filters[1] = FindFilter( p_aout, &pp_filters[0]->fmt_out.audio,
+ p_output_format );
+ if ( pp_filters[1] == NULL )
+ {
+ /* Try to split the conversion. */
+ i_nb_conversions = SplitConversion( &pp_filters[0]->fmt_out.audio,
+ p_output_format, &temp_format );