fix potential bugs
authorYoungjae Shin <yj99.shin@samsung.com>
Sun, 19 Mar 2023 21:36:57 +0000 (06:36 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Sun, 19 Mar 2023 21:38:40 +0000 (06:38 +0900)
common/AittDiscovery.cc
modules/webrtc/SinkStreamManager.cc
modules/webrtc/SrcStreamManager.cc
src/AITTImpl.cc

index ecebce8..cb8725c 100644 (file)
@@ -99,7 +99,7 @@ void AittDiscovery::RemoveDiscoveryCB(int callback_id)
     auto it = callbacks.find(callback_id);
     if (it == callbacks.end()) {
         ERR("Unknown callback_id(%d)", callback_id);
-        throw AittException(AittException::INVALID_ARG);
+        return;
     }
     callbacks.erase(it);
 }
index 6681b2e..5b0228b 100644 (file)
@@ -178,7 +178,7 @@ void SinkStreamManager::HandleStreamState(const std::string &discovery_id,
     else if (src_state.compare("STOP") == 0)
         HandleRemovedClient(discovery_id);
     else
-        ERR("Invalid message %s", src_state);
+        ERR("Invalid message %s", src_state.c_str());
 }
 
 void SinkStreamManager::HandleStartStream(const std::string &discovery_id)
index ab77402..9034dcc 100644 (file)
@@ -83,7 +83,7 @@ void SrcStreamManager::HandleStreamState(const std::string &discovery_id,
     if (sink_state.compare("STOP") == 0)
         HandleRemovedClient(discovery_id);
     else
-        ERR("Invalid message %s", sink_state);
+        ERR("Invalid message %s", sink_state.c_str());
 }
 
 void SrcStreamManager::HandleStreamInfo(const std::string &discovery_id,
index f246cec..3c2984a 100644 (file)
@@ -411,11 +411,11 @@ void *AITT::Impl::SubscribeTCP(SubscribeInfo *handle, const std::string &topic,
     return modules.Get(protocol).Subscribe(
           topic,
           [handle, cb, protocol](AittMsg *msg, const void *data, const int datalen,
-                void *user_data) {
+                void *userdata) {
               msg->SetID(handle);
               msg->SetProtocol(protocol);
 
-              return cb(msg, data, datalen, user_data);
+              return cb(msg, data, datalen, userdata);
           },
           user_data, qos);
 }