diff --git a/src/media_stream.cc b/src/media_stream.cc index f2509cd..50c30bd 100644 --- a/src/media_stream.cc +++ b/src/media_stream.cc @@ -84,7 +84,7 @@ uvgrtp::media_stream::~media_stream() if ( reception_flow_ && (reception_flow_->clear_stream_from_flow(remote_ssrc_, rtp_handler_key_)) == 1) { reception_flow_->stop(); if (sfp_) { - sfp_->clear_port(src_port_, socket_, reception_flow_); + sfp_->clear_port(src_port_, socket_); } } diff --git a/src/reception_flow.cc b/src/reception_flow.cc index 462189e..5c5ccfa 100644 --- a/src/reception_flow.cc +++ b/src/reception_flow.cc @@ -366,14 +366,15 @@ void uvgrtp::reception_flow::call_aux_handlers(uint32_t key, int rce_flags, uvgr auto fr = *frame; uint32_t pkt_ssrc = fr->header.ssrc; uint32_t current_ssrc = handler_mapping_[key].get()->load(); - bool auxh = false; + bool found = false; if (current_ssrc == pkt_ssrc) { - auxh = true; + found = true; } else if (current_ssrc == 0) { - auxh = true; + found = true; } - else { + if (!found) { + // No SSRC match found, skip this handler continue; } @@ -578,21 +579,18 @@ void uvgrtp::reception_flow::process_packet(int rce_flags) uint32_t hnssrc = (uint32_t)ptr[8]; uint32_t current_ssrc = handler_mapping_[handler.first].get()->load(); - bool reth = false; + bool found = false; if (current_ssrc == hnssrc || current_ssrc == nhssrc|| current_ssrc == frame->header.ssrc) { - reth = true; - //UVG_LOG_INFO("Hook ssrc %d", current_ssrc); - + found = true; } else if (current_ssrc == 0) { - reth = true; - //UVG_LOG_INFO("Default hook ssrc 0"); - + found = true; } - else { - + if (!found) { + // No SSRC match found, skip this handler continue; } + frame = nullptr; // Here we don't lock ring mutex because the chaging is only done above. diff --git a/src/rtcp.cc b/src/rtcp.cc index 973efc9..4a043c3 100644 --- a/src/rtcp.cc +++ b/src/rtcp.cc @@ -279,7 +279,7 @@ rtp_error_t uvgrtp::rtcp::stop() } if (rtcp_reader_ && rtcp_reader_->clear_rtcp_from_reader(remote_ssrc_) == 1) { - sfp_->clear_port(local_port_, rtcp_socket_, nullptr); + sfp_->clear_port(local_port_, rtcp_socket_); } return ret; } diff --git a/src/socketfactory.cc b/src/socketfactory.cc index c188651..adc63ca 100644 --- a/src/socketfactory.cc +++ b/src/socketfactory.cc @@ -216,7 +216,7 @@ bool uvgrtp::socketfactory::is_port_in_use(uint16_t port) const return true; } -bool uvgrtp::socketfactory::clear_port(uint16_t port, std::shared_ptr socket, std::shared_ptr flow) +bool uvgrtp::socketfactory::clear_port(uint16_t port, std::shared_ptr socket) { if (port && used_ports_.find(port) != used_ports_.end()) { used_ports_.erase(port); diff --git a/src/socketfactory.hh b/src/socketfactory.hh index 994add1..27afbf2 100644 --- a/src/socketfactory.hh +++ b/src/socketfactory.hh @@ -92,7 +92,7 @@ namespace uvgrtp { * Param port port to be cleared * Param flow that will be cleared from the socket * true on success */ - bool clear_port(uint16_t port, std::shared_ptr socket, std::shared_ptr flow); + bool clear_port(uint16_t port, std::shared_ptr socket); /// \cond DO_NOT_DOCUMENT bool get_ipv6() const;