Drop the last game-name anecdote from a hook comment

Generalize the rate-guess rationale in audio_hook.cpp to describe the
non-device-rate scenario without naming specific games; comment-only.
This commit is contained in:
2026-07-12 09:37:10 +02:00
parent 9a736cf477
commit e0edb80016

View File

@@ -142,13 +142,12 @@ std::atomic<std::uint64_t> g_frames_silenced{0}; // total frames whose local pla
// When we attach to an already-running game we never saw its IAudioClient::Initialize, // When we attach to an already-running game we never saw its IAudioClient::Initialize,
// so a render client discovered on the hot path gets the device mix format as a best // so a render client discovered on the hot path gets the device mix format as a best
// guess. That guess is wrong for games that render at a non-device rate via WASAPI // guess. That guess is wrong for a game that renders at a non-device rate via WASAPI
// AUTOCONVERTPCM -- e.g. Godot/Brotato render 44100 while the device mixes at 48000, so // AUTOCONVERTPCM (e.g. rendering 44100 while the device mixes at 48000), so playing the
// playing the captured 44100 audio back as 48000 shifts the pitch up. For such streams we // captured 44100 audio back as 48000 shifts the pitch up. For such streams we verify (and
// verify (and correct) the guessed sample rate by measuring the real render cadence // correct) the guessed sample rate by measuring the real render cadence before publishing
// before publishing the format. g_stream_rate_guess marks a guessed stream; g_rate_estimator // the format. g_stream_rate_guess marks a guessed stream; g_rate_estimator is its robust,
// is its robust, consensus-based measurement (see rate_estimator.hpp). Both guarded by // consensus-based measurement (see rate_estimator.hpp). Both guarded by g_setup_mutex.
// g_setup_mutex.
bool g_stream_rate_guess[kMaxAudioStreams] = {}; bool g_stream_rate_guess[kMaxAudioStreams] = {};
RateEstimator g_rate_estimator[kMaxAudioStreams] = {}; RateEstimator g_rate_estimator[kMaxAudioStreams] = {};