- if ( pp_filters[0] == NULL && i_nb_conversions == 2 )
- {
- /* Try with only one conversion. */
- SplitConversion( p_aout, p_input_format, &temp_format,
- &temp_format, b_format_first, b_rate_first );
- pp_filters[0] = FindFilter( p_aout, p_input_format,
- &temp_format );
- }
- if ( pp_filters[0] == NULL )
+ }
+ 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. */
+ pp_filters[1] = FindFilter( p_aout, &pp_filters[0]->output,
+ p_output_format );
+ if ( pp_filters[1] == NULL )
+ {
+ /* Try to split the conversion. */
+ i_nb_conversions = SplitConversion( &pp_filters[0]->output,
+ p_output_format, &temp_format );
+ if ( !i_nb_conversions )