output_init: moved the "convert" filter at the end

The "convert" filter must be the last filter in the chain.  Ensure
that by doing its initialization at the very end of
audio_output_init().
This commit is contained in:
Max Kellermann 2009-07-06 21:50:25 +02:00
parent 13e725ab09
commit 171a9ee291

View File

@ -140,11 +140,6 @@ audio_output_init(struct audio_output *ao, const struct config_param *param,
ao->filter = filter_chain_new();
assert(ao->filter != NULL);
ao->convert_filter = filter_new(&convert_filter_plugin, NULL, NULL);
assert(ao->convert_filter != NULL);
filter_chain_append(ao->filter, ao->convert_filter);
ao->thread = NULL;
notify_init(&ao->notify);
ao->command = AO_COMMAND_NONE;
@ -159,5 +154,14 @@ audio_output_init(struct audio_output *ao, const struct config_param *param,
ao->mixer = audio_output_load_mixer(param, plugin->mixer_plugin);
/* the "convert" filter must be the last one in the chain */
ao->convert_filter = filter_new(&convert_filter_plugin, NULL, NULL);
assert(ao->convert_filter != NULL);
filter_chain_append(ao->filter, ao->convert_filter);
/* done */
return true;
}