module-combine-stream: update latency right before playback starts

Combine stream selects the biggest latency from all output streams and sent
the latency upstream. To select the biggest latency, each stream needs to have
the sample rate and the quantum size set.
The combine stream recalculates the latency in the latency changed callback
or during data processing.
Stream sets the sample rate and the quantum size in a copy_position call
which is normally called during processing the output data or when state
changes to streaming.
Before this change, it wasn't guarantee the copy_position was called for
each stream already and latency in the combine stream was selected from
random stream.

Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
This commit is contained in:
Martin Geier 2024-03-25 12:32:29 +01:00
parent 88963e9a9c
commit ff3bc8818f

View file

@ -730,6 +730,9 @@ static void stream_state_changed(void *d, enum pw_stream_state old,
case PW_STREAM_STATE_UNCONNECTED:
stream_destroy(s);
break;
case PW_STREAM_STATE_STREAMING:
update_latency(s->impl);
break;
default:
break;
}