diff --git a/src/base64.cpp b/src/base64.cpp index d14812afd3f41e64717eb2a443c680e4ce8b4b43..639df64ab998d68516bd746602e10c51f16a29e9 100644 --- a/src/base64.cpp +++ b/src/base64.cpp @@ -33,7 +33,7 @@ static const char encoding_table[] = { '3', '4', '5', '6', '7', '8', '9', '+', '/' }; -static const int mod_table[] = { 0, 2, 1 }; +static const size_t mod_table[] = { 0, 2, 1 }; char *ring_base64_encode(const uint8_t *input, size_t input_length, char *output, size_t *output_length) @@ -71,7 +71,7 @@ uint8_t *ring_base64_decode(const char *input, size_t input_length, uint8_t c; for (c = 0; c < 64; c++) - decoding_table[encoding_table[c]] = c; + decoding_table[static_cast<int>(encoding_table[c])] = c; if (input_length % 4 != 0) return NULL; @@ -88,13 +88,13 @@ uint8_t *ring_base64_decode(const char *input, size_t input_length, for (i = 0, j = 0; i < input_length;) { uint8_t sextet_a = input[i] == '=' ? 0 & i++ - : decoding_table[input[i++]]; + : decoding_table[static_cast<int>(input[i++])]; uint8_t sextet_b = input[i] == '=' ? 0 & i++ - : decoding_table[input[i++]]; + : decoding_table[static_cast<int>(input[i++])]; uint8_t sextet_c = input[i] == '=' ? 0 & i++ - : decoding_table[input[i++]]; + : decoding_table[static_cast<int>(input[i++])]; uint8_t sextet_d = input[i] == '=' ? 0 & i++ - : decoding_table[input[i++]]; + : decoding_table[static_cast<int>(input[i++])]; uint32_t triple = (sextet_a << 3 * 6) + (sextet_b << 2 * 6) + diff --git a/src/call.cpp b/src/call.cpp index 7186acadd9217fd474ea756a8a69314f0776d2c9..fbaa48e72b70a8239a561575d68b1bb6e4af7bbb 100644 --- a/src/call.cpp +++ b/src/call.cpp @@ -402,15 +402,18 @@ Call::addSubCall(const std::shared_ptr<Call>& call) std::weak_ptr<Call> wthis = shared_from_this(); std::weak_ptr<Call> wcall = call; - call->addStateListener([wcall,wthis](Call::CallState new_state, Call::ConnectionState new_cstate, int code) { + call->addStateListener([wcall, wthis](Call::CallState new_state, + Call::ConnectionState new_cstate, + UNUSED int code) { if (auto call = wcall.lock()) { if (auto sthis = wthis.lock()) { auto& this_ = *sthis; auto sit = this_.subcalls.find(call); if (sit == this_.subcalls.end()) return; - RING_WARN("[call %s] DeviceCall call %s state changed %d %d", this_.getCallId().c_str(), call->getCallId().c_str(), - static_cast<int>(new_state), static_cast<int>(new_cstate)); + RING_WARN("[call:%s] DeviceCall call %s state changed %d %d", + this_.getCallId().c_str(), call->getCallId().c_str(), + static_cast<int>(new_state), static_cast<int>(new_cstate)); if (new_state == CallState::OVER) { std::lock_guard<std::recursive_mutex> lk (this_.callMutex_); this_.subcalls.erase(call); @@ -421,21 +424,22 @@ Call::addSubCall(const std::shared_ptr<Call>& call) this_.setState(new_cstate); } else if (new_cstate == ConnectionState::DISCONNECTED && new_state == CallState::ACTIVE) { std::lock_guard<std::recursive_mutex> lk (this_.callMutex_); - RING_WARN("[call %s] peer hangup", this_.getCallId().c_str()); + RING_WARN("[call:%s] peer hangup", this_.getCallId().c_str()); auto subcalls = std::move(this_.subcalls); for (auto& sub : subcalls) { if (sub != call) try { sub->hangup(0); } catch(const std::exception& e) { - RING_WARN("[call %s] error hanging up: %s", this_.getCallId().c_str(), e.what()); + RING_WARN("[call:%s] error hanging up: %s", + this_.getCallId().c_str(), e.what()); } } this_.peerHungup(); } if (new_state == CallState::ACTIVE && new_cstate == ConnectionState::CONNECTED) { std::lock_guard<std::recursive_mutex> lk (this_.callMutex_); - RING_WARN("[call %s] peer answer", this_.getCallId().c_str()); + RING_WARN("[call:%s] peer answer", this_.getCallId().c_str()); auto subcalls = std::move(this_.subcalls); for (auto& sub : subcalls) { if (sub != call) @@ -444,12 +448,14 @@ Call::addSubCall(const std::shared_ptr<Call>& call) this_.merge(call); Manager::instance().peerAnsweredCall(this_); } - RING_WARN("[call %s] Remaining %d subcalls", this_.getCallId().c_str(), static_cast<int>(this_.subcalls.size())); + RING_WARN("[call:%s] Remaining %zu subcalls", this_.getCallId().c_str(), + this_.subcalls.size()); if (this_.subcalls.empty()) this_.pendingOutMessages_.clear(); } else { - RING_WARN("DeviceCall IGNORED call %s state changed %d %d", call->getCallId().c_str(), - static_cast<int>(new_state), static_cast<int>(new_cstate)); + RING_WARN("DeviceCall IGNORED call %s state changed %d %d", + call->getCallId().c_str(), static_cast<int>(new_state), + static_cast<int>(new_cstate)); } } }); @@ -460,7 +466,7 @@ Call::addSubCall(const std::shared_ptr<Call>& call) void Call::merge(std::shared_ptr<Call> scall) { - RING_WARN("[call %s] merge to -> [call %s]", scall->getCallId().c_str(), getCallId().c_str()); + RING_WARN("[call:%s] merge to -> [call:%s]", scall->getCallId().c_str(), getCallId().c_str()); auto& call = *scall; std::lock(callMutex_, call.callMutex_); std::lock_guard<std::recursive_mutex> lk1 (callMutex_, std::adopt_lock); diff --git a/src/media/audio/alsa/alsalayer.cpp b/src/media/audio/alsa/alsalayer.cpp index 9ee2906a779367ed773f56bf1e01dcb36d57c0f0..1e04c8b3a89ba3abcc1e32efa72bc1e040f1c7b9 100644 --- a/src/media/audio/alsa/alsalayer.cpp +++ b/src/media/audio/alsa/alsalayer.cpp @@ -743,7 +743,7 @@ void AlsaLayer::playback() auto& playBuff = getToPlay(audioFormat_, maxFrames); auto& toPlay = ringBuff.frames() > 0 ? ringBuff : playBuff; - if (!toPlay.frames() > 0) + if (!(toPlay.frames() > 0)) return; toPlay.interleave(playbackIBuff_); diff --git a/src/media/video/v4l2/vaapi.cpp b/src/media/video/v4l2/vaapi.cpp index ebe3b3d8802c701a3601f32782d3d405e701fc49..4129573efcaf2e3c7141aae9f242a5ec0c27a4da 100644 --- a/src/media/video/v4l2/vaapi.cpp +++ b/src/media/video/v4l2/vaapi.cpp @@ -55,6 +55,7 @@ VaapiAccel::~VaapiAccel() int VaapiAccel::allocateBuffer(AVFrame* frame, int flags) { + (void) flags; // unused return av_hwframe_get_buffer(framesBufferRef_.get(), frame, 0); } diff --git a/src/media/video/video_receive_thread.cpp b/src/media/video/video_receive_thread.cpp index b2769d513419485fe63afcf9623bcf242e6bac84..cd600ce46fe3d00ca79fe3b99efcb7bc67760136 100644 --- a/src/media/video/video_receive_thread.cpp +++ b/src/media/video/video_receive_thread.cpp @@ -45,10 +45,10 @@ VideoReceiveThread::VideoReceiveThread(const std::string& id, , dstHeight_(0) , id_(id) , stream_(sdp) - , restartDecoder_(false) - , isReset_(isReset) , sdpContext_(stream_.str().size(), false, &readFunction, 0, 0, this) , sink_ {Manager::instance().createSinkClient(id)} + , restartDecoder_(false) + , isReset_(isReset) , requestKeyFrameCallback_(0) , loop_(std::bind(&VideoReceiveThread::setup, this), std::bind(&VideoReceiveThread::process, this), diff --git a/src/ringdht/ringaccount.cpp b/src/ringdht/ringaccount.cpp index 40e57a56bf32d1e6a9e1d441742680d797d2e7ea..a464713061bebaa767885579dce9ee327fdfb5b3 100644 --- a/src/ringdht/ringaccount.cpp +++ b/src/ringdht/ringaccount.cpp @@ -437,7 +437,8 @@ RingAccount::startOutgoingCall(const std::shared_ptr<SIPCall>& call, const std:: std::chrono::steady_clock::now(), ice, weak_dev_call, std::move(listenKey), - callkey, dev + callkey, dev, + nullptr }); return false; });