xz: Make setting a preset override a custom filter chain.

This is more logical behavior than ignoring preset level
options once a custom filter chain has been specified.
This commit is contained in:
Lasse Collin 2010-09-02 19:22:35 +03:00
parent b3ff7ba044
commit a848e47ced
1 changed files with 9 additions and 0 deletions

View File

@ -67,6 +67,15 @@ extern void
coder_set_preset(size_t new_preset) coder_set_preset(size_t new_preset)
{ {
preset_number = new_preset; preset_number = new_preset;
// Setting a preset makes us forget a possibly defined custom
// filter chain.
while (filters_count > 0) {
--filters_count;
free(filters[filters_count].options);
filters[filters_count].options = NULL;
}
return; return;
} }