test_codec: set the DSP's output samplerate

The DSP gets its output samplerate from the codec thread when a
track is played. test_codec did not set it, so its runs with the
DSP used the rate of the last track played, or the default if
there was none: after "Playback frequency" was changed, they
resampled to the old rate until something had been played.

Set it from the mixer for each file, as the codec thread does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Michael Giacomelli 2026-10-06 22:10:24 -04:00
parent e27fb9a9f0
commit 4c08906670

View file

@ -726,6 +726,11 @@ static enum plugin_status test_track(const char* filename)
if (use_dsp) {
rb->dsp_configure(ci.dsp, DSP_RESET, 0);
/* The DSP is told its output samplerate when a track is played.
* Tell it here as well, or it is that of the last track and not
* what playback would use now. */
rb->dsp_configure(ci.dsp, DSP_SET_OUT_FREQUENCY,
rb->mixer_get_frequency());
rb->dsp_configure(ci.dsp, DSP_FLUSH, 0);
}