mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-02 14:19:05 +00:00
Disable audio regulator underflow logs
Only enable them if SC_AUDIO_REGULATOR_DEBUG is set, as they may spam the output. PR #5870 <https://github.com/Genymobile/scrcpy/pull/5870>
This commit is contained in:
parent
c63d9e1803
commit
457c7fe5cf
1 changed files with 5 additions and 1 deletions
|
@ -76,8 +76,10 @@ sc_audio_regulator_pull(struct sc_audio_regulator *ar, uint8_t *out,
|
||||||
// Wait until the buffer is filled up to at least target_buffering
|
// Wait until the buffer is filled up to at least target_buffering
|
||||||
// before playing
|
// before playing
|
||||||
if (buffered_samples < ar->target_buffering) {
|
if (buffered_samples < ar->target_buffering) {
|
||||||
LOGV("[Audio] Inserting initial buffering silence: %" PRIu32
|
#ifdef SC_AUDIO_REGULATOR_DEBUG
|
||||||
|
LOGD("[Audio] Inserting initial buffering silence: %" PRIu32
|
||||||
" samples", out_samples);
|
" samples", out_samples);
|
||||||
|
#endif
|
||||||
// Delay playback starting to reach the target buffering. Fill the
|
// Delay playback starting to reach the target buffering. Fill the
|
||||||
// whole buffer with silence (len is small compared to the
|
// whole buffer with silence (len is small compared to the
|
||||||
// arbitrary margin value).
|
// arbitrary margin value).
|
||||||
|
@ -98,8 +100,10 @@ sc_audio_regulator_pull(struct sc_audio_regulator *ar, uint8_t *out,
|
||||||
// dropped to keep the latency minimal. However, this would cause very
|
// dropped to keep the latency minimal. However, this would cause very
|
||||||
// audible glitches, so let the clock compensation restore the target
|
// audible glitches, so let the clock compensation restore the target
|
||||||
// latency.
|
// latency.
|
||||||
|
#ifdef SC_AUDIO_REGULATOR_DEBUG
|
||||||
LOGD("[Audio] Buffer underflow, inserting silence: %" PRIu32 " samples",
|
LOGD("[Audio] Buffer underflow, inserting silence: %" PRIu32 " samples",
|
||||||
silence);
|
silence);
|
||||||
|
#endif
|
||||||
memset(out + TO_BYTES(read), 0, TO_BYTES(silence));
|
memset(out + TO_BYTES(read), 0, TO_BYTES(silence));
|
||||||
|
|
||||||
bool received = atomic_load_explicit(&ar->received,
|
bool received = atomic_load_explicit(&ar->received,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue