diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-12-15 01:05:33 +0100 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-12-15 01:57:06 +0100 |
commit | 0471998e13aada9a76e92b13ab3885c2d1c2fb84 (patch) | |
tree | 776d15ab92ef044956940bc2228b61256ca4feb9 /src/engine/sidechain | |
parent | 63b858b5d827797eec959d009ad0b970de167dc5 (diff) |
Add missing braces around single-line statements
Diffstat (limited to 'src/engine/sidechain')
-rw-r--r-- | src/engine/sidechain/shoutconnection.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/engine/sidechain/shoutconnection.cpp b/src/engine/sidechain/shoutconnection.cpp index 2407df7516..6f77a9fdf7 100644 --- a/src/engine/sidechain/shoutconnection.cpp +++ b/src/engine/sidechain/shoutconnection.cpp @@ -106,8 +106,9 @@ ShoutConnection::ShoutConnection(BroadcastProfilePtr profile, ShoutConnection::~ShoutConnection() { delete m_pMasterSamplerate; - if (m_pShoutMetaData) + if (m_pShoutMetaData) { shout_metadata_free(m_pShoutMetaData); + } if (m_pShout) { shout_close(m_pShout); @@ -128,8 +129,9 @@ ShoutConnection::~ShoutConnection() { bool ShoutConnection::isConnected() { if (m_pShout) { m_iShoutStatus = shout_get_connected(m_pShout); - if (m_iShoutStatus == SHOUTERR_CONNECTED) + if (m_iShoutStatus == SHOUTERR_CONNECTED) { return true; + } } return false; } @@ -137,9 +139,9 @@ bool ShoutConnection::isConnected() { // Only called when applying settings while broadcasting is active void ShoutConnection::applySettings() { // Do nothing if profile or Live Broadcasting is disabled - if(!m_pBroadcastEnabled->toBool() - || !m_pProfile->getEnabled()) + if (!m_pBroadcastEnabled->toBool() || !m_pProfile->getEnabled()) { return; + } // Setting the profile's enabled value to false tells the // connection's thread to exit, so no need to call @@ -465,8 +467,9 @@ void ShoutConnection::updateFromPreferences() { } bool ShoutConnection::serverConnect() { - if(!m_pProfile->getEnabled()) + if (!m_pProfile->getEnabled()) { return false; + } start(QThread::HighPriority); setState(NETWORKSTREAMWORKER_STATE_CONNECTING); @@ -701,14 +704,16 @@ bool ShoutConnection::writeSingle(const unsigned char* data, size_t len) { void ShoutConnection::process(const CSAMPLE* pBuffer, const int iBufferSize) { setFunctionCode(4); - if(!m_pProfile->getEnabled()) + if (!m_pProfile->getEnabled()) { return; + } setState(NETWORKSTREAMWORKER_STATE_BUSY); // If we aren't connected, bail. - if (m_iShoutStatus != SHOUTERR_CONNECTED) + if (m_iShoutStatus != SHOUTERR_CONNECTED) { return; + } // If we are connected, encode the samples. if (iBufferSize > 0 && m_encoder) { @@ -737,8 +742,9 @@ bool ShoutConnection::metaDataHasChanged() { m_iMetaDataLife = 0; pTrack = PlayerInfo::instance().getCurrentPlayingTrack(); - if (!pTrack) + if (!pTrack) { return false; + } if (m_pMetaData) { if (!pTrack->getId().isValid() || !m_pMetaData->getId().isValid()) { |