-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround for jack sample rate mismatch
During creation of a jack audio driver, it is checked whether the sample-rate of the settings object matches jack's rate. If not, it was adjusted previously via fluid_synth_set_sample_rate(). Due to the deprecation of that function and removal of real-time capability of synth.sample-rate setting, a regression was introduced in 5fbddce causing the synth's sample-rate to be not updated. This workaround obtains the synth via the settings instance and for now calls the deprecated sample-rate set function.
- Loading branch information
Showing
7 changed files
with
97 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
#include "test.h" | ||
#include "fluidsynth.h" | ||
#include "fluid_adriver.h" | ||
|
||
// The jack driver may need the synth instance to adjust the sample-rate in case it mismatches with | ||
// the sample-rate of the jack driver. However, new_fluid_audio_driver2() does not receive a synth pointer. | ||
// Thus looking up the synth instance must be done via the settings object. | ||
int main(void) | ||
{ | ||
#if JACK_SUPPORT | ||
fluid_synth_t *obtained_synth; | ||
fluid_synth_t *expected_synth; | ||
fluid_settings_t *settings = new_fluid_settings(); | ||
TEST_ASSERT(settings != NULL); | ||
|
||
expected_synth = new_fluid_synth(settings); | ||
TEST_ASSERT(expected_synth != NULL); | ||
|
||
TEST_SUCCESS(fluid_jack_obtain_synth(settings, &obtained_synth)); | ||
TEST_ASSERT(obtained_synth == expected_synth); | ||
|
||
delete_fluid_synth(obtained_synth); | ||
delete_fluid_settings(settings); | ||
#endif | ||
return EXIT_SUCCESS; | ||
} |