Skip to content

Commit

Permalink
Merge pull request #20808 from thexai/fix-CLog
Browse files Browse the repository at this point in the history
Various CLog fixes after PR20718 merge
  • Loading branch information
thexai committed Jan 7, 2022
2 parents 2e6a104 + bf81723 commit 1d0dc77
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
6 changes: 3 additions & 3 deletions xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp
Expand Up @@ -747,9 +747,9 @@ bool CAESinkWASAPI::InitializeExclusive(AEAudioFormat &format)
else if (format.m_dataFormat == AE_FMT_RAW) //No sense in trying other formats for passthrough.
return false;

CLog::LogF(LOGDEBUG, LOGAUDIO,
"IsFormatSupported failed ({}) - trying to find a compatible format",
WASAPIErrToStr(hr));
CLog::LogFC(LOGDEBUG, LOGAUDIO,
"IsFormatSupported failed ({}) - trying to find a compatible format",
WASAPIErrToStr(hr));

requestedChannels = wfxex.Format.nChannels;
desired_map = CAESinkFactoryWin::SpeakerMaskFromAEChannels(format.m_channelLayout);
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/AudioEngine/Sinks/windows/AESinkFactoryWin.cpp
Expand Up @@ -45,7 +45,7 @@ const char *WASAPIErrToStr(HRESULT err)
ERRTOSTR(E_OUTOFMEMORY);
default: break;
}
return NULL;
return "Undefined";
}

void CAESinkFactoryWin::AEChannelsFromSpeakerMask(CAEChannelInfo& channelLayout, DWORD speakers)
Expand Down
6 changes: 3 additions & 3 deletions xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.cpp
Expand Up @@ -135,9 +135,9 @@ bool CProcessorHD::InitProcessor()
}

CLog::LogF(LOGDEBUG, "video processor has {} rate conversion.", m_vcaps.RateConversionCapsCount);
CLog::LogF(LOGDEBUG, "video processor has %#x feature caps.", m_vcaps.FeatureCaps);
CLog::LogF(LOGDEBUG, "video processor has %#x device caps.", m_vcaps.DeviceCaps);
CLog::LogF(LOGDEBUG, "video processor has %#x input format caps.", m_vcaps.InputFormatCaps);
CLog::LogF(LOGDEBUG, "video processor has {:#x} feature caps.", m_vcaps.FeatureCaps);
CLog::LogF(LOGDEBUG, "video processor has {:#x} device caps.", m_vcaps.DeviceCaps);
CLog::LogF(LOGDEBUG, "video processor has {:#x} input format caps.", m_vcaps.InputFormatCaps);
CLog::LogF(LOGDEBUG, "video processor has {} max input streams.", m_vcaps.MaxInputStreams);
CLog::LogF(LOGDEBUG, "video processor has {} max stream states.", m_vcaps.MaxStreamStates);
if (m_vcaps.FeatureCaps & D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_METADATA_HDR10)
Expand Down
10 changes: 5 additions & 5 deletions xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp
Expand Up @@ -1165,11 +1165,11 @@ void CRenderManager::PrepareNextRender()
m_dvdClock.SetVsyncAdjust(0);
}

CLog::LogF(LOGDEBUG, LOGAVTIMING,
"frameOnScreen: {:f} renderPts: {:f} nextFramePts: {:f} -> diff: {:f} render: {} "
"forceNext: {}",
frameOnScreen, renderPts, nextFramePts, (renderPts - nextFramePts),
renderPts >= nextFramePts, m_forceNext);
CLog::LogFC(LOGDEBUG, LOGAVTIMING,
"frameOnScreen: {:f} renderPts: {:f} nextFramePts: {:f} -> diff: {:f} render: {} "
"forceNext: {}",
frameOnScreen, renderPts, nextFramePts, (renderPts - nextFramePts),
renderPts >= nextFramePts, m_forceNext);

bool combined = false;
if (m_presentsourcePast >= 0)
Expand Down
2 changes: 1 addition & 1 deletion xbmc/platform/posix/filesystem/SMBDirectory.cpp
Expand Up @@ -272,7 +272,7 @@ int CSMBDirectory::OpenDir(const CURL& url, std::string& strAuth)
s.erase(len - 1, 1);
}

CLog::LogF(LOGDEBUG, LOGSAMBA, "Using authentication url {}", CURL::GetRedacted(s));
CLog::LogFC(LOGDEBUG, LOGSAMBA, "Using authentication url {}", CURL::GetRedacted(s));

{ CSingleLock lock(smb);
if (!smb.IsSmbValid())
Expand Down
5 changes: 2 additions & 3 deletions xbmc/utils/log.h
Expand Up @@ -112,10 +112,9 @@ class CLog : public ISettingsHandler, public ISettingCallback
Log(level, format, std::forward<Args>(args)...);
}

#define LogF(level, format, ...) \
Log((level), ("{}: " DEF_TO_STR_VALUE(format)), __FUNCTION__, ##__VA_ARGS__)
#define LogF(level, format, ...) Log((level), ("{}: " format), __FUNCTION__, ##__VA_ARGS__)
#define LogFC(level, component, format, ...) \
Log((level), (component), ("{}: " DEF_TO_STR_VALUE(format)), __FUNCTION__, ##__VA_ARGS__)
Log((level), (component), ("{}: " format), __FUNCTION__, ##__VA_ARGS__)

private:
static CLog& GetInstance();
Expand Down
4 changes: 2 additions & 2 deletions xbmc/video/VideoDatabase.cpp
Expand Up @@ -9397,15 +9397,15 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const st
// Otherwise there is a mismatch between the path contents and the hash in the
// database, leading to potentially missed items on re-scan (if deleted files are
// later re-added to a source)
CLog::LogF(LOGDEBUG, LOGDATABASE, "Cleaning path hashes");
CLog::LogFC(LOGDEBUG, LOGDATABASE, "Cleaning path hashes");
m_pDS->query("SELECT DISTINCT strPath FROM path JOIN files ON files.idPath=path.idPath WHERE files.idFile IN " + filesToDelete);
int pathHashCount = m_pDS->num_rows();
while (!m_pDS->eof())
{
InvalidatePathHash(m_pDS->fv("strPath").get_asString());
m_pDS->next();
}
CLog::LogF(LOGDEBUG, LOGDATABASE, "Cleaned {} path hashes", pathHashCount);
CLog::LogFC(LOGDEBUG, LOGDATABASE, "Cleaned {} path hashes", pathHashCount);

CLog::Log(LOGDEBUG, LOGDATABASE, "{}: Cleaning files table", __FUNCTION__);
sql = "DELETE FROM files WHERE idFile IN " + filesToDelete;
Expand Down

0 comments on commit 1d0dc77

Please sign in to comment.