mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
[AFV] Ref T739, we are checking "connected" already, no need to check it again
This commit is contained in:
committed by
Mat Sutcliffe
parent
e3ed71a919
commit
f15674330f
@@ -563,7 +563,10 @@ namespace BlackCore
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! m_connection->isConnected()) { return; }
|
{
|
||||||
|
QMutexLocker lock(&m_mutex);
|
||||||
|
if (!m_connection->isConnected()) { return; }
|
||||||
|
}
|
||||||
|
|
||||||
const QString callsign = this->getCallsign(); // threadsafe
|
const QString callsign = this->getCallsign(); // threadsafe
|
||||||
const auto transmittingTransceivers = this->getTransmittingTransceivers(); // threadsafe
|
const auto transmittingTransceivers = this->getTransmittingTransceivers(); // threadsafe
|
||||||
@@ -571,32 +574,26 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
if (transmit)
|
if (transmit)
|
||||||
{
|
{
|
||||||
|
AudioTxOnTransceiversDto dto;
|
||||||
|
dto.callsign = callsign.toStdString();
|
||||||
|
dto.sequenceCounter = args.sequenceCounter;
|
||||||
|
dto.audio = std::vector<char>(args.audio.begin(), args.audio.end());
|
||||||
|
dto.lastPacket = false;
|
||||||
|
dto.transceivers = transmittingTransceivers.toStdVector();
|
||||||
QMutexLocker lock(&m_mutex);
|
QMutexLocker lock(&m_mutex);
|
||||||
if (m_connection->isConnected())
|
m_connection->sendToVoiceServer(dto);
|
||||||
{
|
|
||||||
AudioTxOnTransceiversDto dto;
|
|
||||||
dto.callsign = callsign.toStdString();
|
|
||||||
dto.sequenceCounter = args.sequenceCounter;
|
|
||||||
dto.audio = std::vector<char>(args.audio.begin(), args.audio.end());
|
|
||||||
dto.lastPacket = false;
|
|
||||||
dto.transceivers = transmittingTransceivers.toStdVector();
|
|
||||||
m_connection->sendToVoiceServer(dto);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!transmit && transmitHistory)
|
if (!transmit && transmitHistory)
|
||||||
{
|
{
|
||||||
|
AudioTxOnTransceiversDto dto;
|
||||||
|
dto.callsign = callsign.toStdString();
|
||||||
|
dto.sequenceCounter = args.sequenceCounter;
|
||||||
|
dto.audio = std::vector<char>(args.audio.begin(), args.audio.end());
|
||||||
|
dto.lastPacket = true;
|
||||||
|
dto.transceivers = transmittingTransceivers.toStdVector();
|
||||||
QMutexLocker lock(&m_mutex);
|
QMutexLocker lock(&m_mutex);
|
||||||
if (m_connection->isConnected())
|
m_connection->sendToVoiceServer(dto);
|
||||||
{
|
|
||||||
AudioTxOnTransceiversDto dto;
|
|
||||||
dto.callsign = callsign.toStdString();
|
|
||||||
dto.sequenceCounter = args.sequenceCounter;
|
|
||||||
dto.audio = std::vector<char>(args.audio.begin(), args.audio.end());
|
|
||||||
dto.lastPacket = true;
|
|
||||||
dto.transceivers = transmittingTransceivers.toStdVector();
|
|
||||||
m_connection->sendToVoiceServer(dto);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
m_transmitHistory = transmit; // threadsafe
|
m_transmitHistory = transmit; // threadsafe
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user