Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lazy NACK timeouts enabling #501

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/change/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl<'a> DirectApi<'a> {

/// Obtain a recv stream by looking it up via mid/rid.
pub fn stream_rx_by_mid(&mut self, mid: Mid, rid: Option<Rid>) -> Option<&mut StreamRx> {
self.rtc.session.streams.rx_by_mid_rid(mid, rid)
self.rtc.session.streams.stream_rx_by_mid_rid(mid, rid)
}

/// Declare the intention to send data using the given SSRC.
Expand Down Expand Up @@ -267,6 +267,6 @@ impl<'a> DirectApi<'a> {

/// Obtain a send stream by looking it up via mid/rid.
pub fn stream_tx_by_mid(&mut self, mid: Mid, rid: Option<Rid>) -> Option<&mut StreamTx> {
self.rtc.session.streams.tx_by_mid_rid(mid, rid)
self.rtc.session.streams.stream_tx_by_mid_rid(mid, rid)
}
}
2 changes: 1 addition & 1 deletion src/media/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl Media {

let is_audio = self.kind.is_audio();

let stream = streams.tx_by_mid_rid(self.mid, *rid);
let stream = streams.stream_tx_by_mid_rid(self.mid, *rid);

let Some(stream) = stream else {
return Err(RtcError::NoSenderSource);
Expand Down
2 changes: 1 addition & 1 deletion src/media/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl<'a> Writer<'a> {
let stream = self
.session
.streams
.rx_by_mid_rid(self.mid, rid)
.stream_rx_by_mid_rid(self.mid, rid)
.ok_or_else(|| RtcError::NoReceiverSource(rid))?;

stream.request_keyframe(kind);
Expand Down
12 changes: 0 additions & 12 deletions src/streams/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,18 +442,6 @@ impl Streams {
}
}

pub(crate) fn tx_by_mid_rid(&mut self, mid: Mid, rid: Option<Rid>) -> Option<&mut StreamTx> {
self.streams_tx
.values_mut()
.find(|s| s.mid() == mid && (rid.is_none() || s.rid() == rid))
}

pub(crate) fn rx_by_mid_rid(&mut self, mid: Mid, rid: Option<Rid>) -> Option<&mut StreamRx> {
self.streams_rx
.values_mut()
.find(|s| s.mid() == mid && (rid.is_none() || s.rid() == rid))
}

pub(crate) fn poll_keyframe_request(&mut self) -> Option<KeyframeRequest> {
self.streams_tx.values_mut().find_map(|s| {
let kind = s.poll_keyframe_request()?;
Expand Down
Loading