Driver: Fix transition to Live on connect (#222)

This PR fixes a case where a call which changes channel or gracefully
reconnects would have been stuck in the Idle state. SetConn events will
now allow a transition straight back to Live if any tracks are found
attached to a mixer.
This commit is contained in:
Kyle Simpson
2024-01-24 09:30:50 +00:00
committed by GitHub
parent 1b98c30746
commit 087e5f2292
4 changed files with 19 additions and 9 deletions

View File

@@ -116,7 +116,7 @@ impl ParkedMixer {
_ = kill_rx.recv_async() => break,
msg = remote_rx.recv_async() => {
let exit = if let Ok(msg) = msg {
let remove_self = msg.is_mixer_now_live();
let remove_self = msg.is_mixer_maybe_live();
tx.send_async(SchedulerMessage::Do(id, msg)).await.is_err() || remove_self
} else {
true
@@ -135,7 +135,8 @@ impl ParkedMixer {
pub fn handle_message(&mut self, msg: MixerMessage) -> Result<bool, ()> {
match msg {
MixerMessage::SetConn(conn, ssrc) => {
// Overridden because
// Overridden because payload-specific fields are carried
// externally on `ParkedMixer`.
self.ssrc = ssrc;
self.rtp_sequence = random::<u16>();
self.rtp_timestamp = random::<u32>();