Skip to content

Commit

Permalink
fix sender_report bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yngrtc committed Feb 4, 2024
1 parent a7f82b5 commit 3c0b906
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rtc
Submodule rtc updated from 7add9a to 22defe
4 changes: 4 additions & 0 deletions src/handler/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ impl InboundHandler for GatewayInbound {
}
}
}

fn handle_timeout(&mut self, _ctx: &InboundContext<Self::Rin, Self::Rout>, _now: Instant) {
// terminate timeout here, no more ctx.fire_handle_timeout(now);
}
}

impl OutboundHandler for GatewayOutbound {
Expand Down
8 changes: 6 additions & 2 deletions src/handler/srtp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ impl InboundHandler for SrtpInbound {
let compound_packet = CompoundPacket(rtcp_packets);
compound_packet.validate()?;
compound_packet.0
} else {
} else if !rtcp_packets.is_empty() {
rtcp_packets
} else {
return Err(Error::Other("empty rtcp_packets".to_string()));
};
Ok(MessageEvent::Rtp(RTPMessageEvent::Rtcp(rtcp_packets)))
} else {
Expand Down Expand Up @@ -115,8 +117,10 @@ impl OutboundHandler for SrtpOutbound {
let compound_packet = CompoundPacket(rtcp_packets);
compound_packet.validate()?;
compound_packet.0
} else {
} else if !rtcp_packets.is_empty() {
rtcp_packets
} else {
return Err(Error::Other("empty rtcp_packets".to_string()));
};

let mut local_context = transport.local_srtp_context();
Expand Down
12 changes: 7 additions & 5 deletions src/interceptor/report/sender_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ impl Interceptor for SenderReport {
inbound_rtcp_packets.push(rtcp_packets[0].clone());
}

interceptor_events.push(InterceptorEvent::Inbound(TaggedMessageEvent {
now: msg.now,
transport: msg.transport,
message: MessageEvent::Rtp(RTPMessageEvent::Rtcp(inbound_rtcp_packets)),
}));
if !inbound_rtcp_packets.is_empty() {
interceptor_events.push(InterceptorEvent::Inbound(TaggedMessageEvent {
now: msg.now,
transport: msg.transport,
message: MessageEvent::Rtp(RTPMessageEvent::Rtcp(inbound_rtcp_packets)),
}));
}
}

if let Some(next) = self.next.as_mut() {
Expand Down

0 comments on commit 3c0b906

Please sign in to comment.