Davide Beatrici (@davidebeatrici) commented about dlls/winepulse.drv/pulse.c:
- else
- {
if (!(o = pa_stream_update_sample_rate(stream->stream, params->rate, pulse_op_cb, &success)))
success = 0;
else
{
while (pa_operation_get_state(o) == PA_OPERATION_RUNNING)
pulse_cond_wait();
pa_operation_unref(o);
}
if (!success) hr = E_FAIL;
else
{
stream->ss.rate = params->rate;
stream->period_bytes = pa_frame_size(&stream->ss) * muldiv(stream->mmdev_period_usec, stream->ss.rate, 1000000);
Unfortunately this isn't sufficient. It may work in practice just because there is enough headroom, as we ensure the buffer can contain a minimum of 3 full periods.
In short: `stream->local_buffer` has to be reallocated to take the increased/decreased sample rate into account.