multiplex: Fix Werrors

This commit is contained in:
Heikki Tampio 2023-05-11 12:50:03 +03:00
parent 40f7329ea6
commit 44484f14d8
5 changed files with 15 additions and 17 deletions

View File

@ -84,7 +84,7 @@ uvgrtp::media_stream::~media_stream()
if ( reception_flow_ && (reception_flow_->clear_stream_from_flow(remote_ssrc_, rtp_handler_key_)) == 1) { if ( reception_flow_ && (reception_flow_->clear_stream_from_flow(remote_ssrc_, rtp_handler_key_)) == 1) {
reception_flow_->stop(); reception_flow_->stop();
if (sfp_) { if (sfp_) {
sfp_->clear_port(src_port_, socket_, reception_flow_); sfp_->clear_port(src_port_, socket_);
} }
} }

View File

@ -366,14 +366,15 @@ void uvgrtp::reception_flow::call_aux_handlers(uint32_t key, int rce_flags, uvgr
auto fr = *frame; auto fr = *frame;
uint32_t pkt_ssrc = fr->header.ssrc; uint32_t pkt_ssrc = fr->header.ssrc;
uint32_t current_ssrc = handler_mapping_[key].get()->load(); uint32_t current_ssrc = handler_mapping_[key].get()->load();
bool auxh = false; bool found = false;
if (current_ssrc == pkt_ssrc) { if (current_ssrc == pkt_ssrc) {
auxh = true; found = true;
} }
else if (current_ssrc == 0) { else if (current_ssrc == 0) {
auxh = true; found = true;
} }
else { if (!found) {
// No SSRC match found, skip this handler
continue; continue;
} }
@ -578,21 +579,18 @@ void uvgrtp::reception_flow::process_packet(int rce_flags)
uint32_t hnssrc = (uint32_t)ptr[8]; uint32_t hnssrc = (uint32_t)ptr[8];
uint32_t current_ssrc = handler_mapping_[handler.first].get()->load(); 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) { if (current_ssrc == hnssrc || current_ssrc == nhssrc|| current_ssrc == frame->header.ssrc) {
reth = true; found = true;
//UVG_LOG_INFO("Hook ssrc %d", current_ssrc);
} }
else if (current_ssrc == 0) { else if (current_ssrc == 0) {
reth = true; found = true;
//UVG_LOG_INFO("Default hook ssrc 0");
} }
else { if (!found) {
// No SSRC match found, skip this handler
continue; continue;
} }
frame = nullptr; frame = nullptr;
// Here we don't lock ring mutex because the chaging is only done above. // Here we don't lock ring mutex because the chaging is only done above.

View File

@ -279,7 +279,7 @@ rtp_error_t uvgrtp::rtcp::stop()
} }
if (rtcp_reader_ && rtcp_reader_->clear_rtcp_from_reader(remote_ssrc_) == 1) { 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; return ret;
} }

View File

@ -216,7 +216,7 @@ bool uvgrtp::socketfactory::is_port_in_use(uint16_t port) const
return true; return true;
} }
bool uvgrtp::socketfactory::clear_port(uint16_t port, std::shared_ptr<uvgrtp::socket> socket, std::shared_ptr<uvgrtp::reception_flow> flow) bool uvgrtp::socketfactory::clear_port(uint16_t port, std::shared_ptr<uvgrtp::socket> socket)
{ {
if (port && used_ports_.find(port) != used_ports_.end()) { if (port && used_ports_.find(port) != used_ports_.end()) {
used_ports_.erase(port); used_ports_.erase(port);

View File

@ -92,7 +92,7 @@ namespace uvgrtp {
* Param port port to be cleared * Param port port to be cleared
* Param flow that will be cleared from the socket * Param flow that will be cleared from the socket
* true on success */ * true on success */
bool clear_port(uint16_t port, std::shared_ptr<uvgrtp::socket> socket, std::shared_ptr<uvgrtp::reception_flow> flow); bool clear_port(uint16_t port, std::shared_ptr<uvgrtp::socket> socket);
/// \cond DO_NOT_DOCUMENT /// \cond DO_NOT_DOCUMENT
bool get_ipv6() const; bool get_ipv6() const;