From 15342190faf840da49c979fdcf01304d90e6c565 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 4 Apr 2020 12:53:03 -0700 Subject: [PATCH] Make audio debug logs more readable --- app/streaming/audio/renderers/sdlaud.cpp | 4 ++-- app/streaming/session.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/streaming/audio/renderers/sdlaud.cpp b/app/streaming/audio/renderers/sdlaud.cpp index 68507717..6a4efe06 100644 --- a/app/streaming/audio/renderers/sdlaud.cpp +++ b/app/streaming/audio/renderers/sdlaud.cpp @@ -81,9 +81,9 @@ bool SdlAudioRenderer::prepareForPlayback(const OPUS_MULTISTREAM_CONFIGURATION* } SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, - "Desired audio buffer: %u samples (%zu bytes)", + "Desired audio buffer: %u samples (%u bytes)", want.samples, - want.samples * sizeof(short) * want.channels); + want.samples * (Uint32)sizeof(short) * want.channels); SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Obtained audio buffer: %u samples (%u bytes)", diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 623b5d2f..d1e42339 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -406,8 +406,11 @@ bool Session::initialize() m_AudioCallbacks.capabilities = getAudioRendererCapabilities(m_StreamConfig.audioConfiguration); SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, - "Audio configuration: %d", - m_StreamConfig.audioConfiguration); + "Audio channel count: %d", + CHANNEL_COUNT_FROM_AUDIO_CONFIGURATION(m_StreamConfig.audioConfiguration)); + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, + "Audio channel mask: %X", + CHANNEL_MASK_FROM_AUDIO_CONFIGURATION(m_StreamConfig.audioConfiguration)); switch (m_Preferences->videoCodecConfig) {