Skip to content

Commit

Permalink
Audio: Minor fix for da465f8. Use the original threshold when determi…
Browse files Browse the repository at this point in the history
…ning whether to start auto-suspending or not (just don"t use the autosuspend-threshold when determining whether signal is silent or not).
  • Loading branch information
kjetil_matheussen committed Jan 14, 2024
1 parent a83323d commit db57fe0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions audio/SoundPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ extern "C"{
#define MAX_DB_GAIN 56.23413251903491 // = powf(10, MAX_DB/20.0f);
#define THRESHOLD_GAIN 0.01778279410038923 // = powf(10, MIN_DB_THRESHOLD / 20.0f);

#define MIN_AUTOSUSPEND_PEAK (1000000.0f * 0.000000000000000000000000000000000000012207031820f) // I.e. 1000000 times size of largest denormal.
//#define MIN_AUTOSUSPEND_PEAK 0.00035565046709962195 // = db2gain(MIN_DB_A_LITTLE_BIT_ABOVE)
#define MIN_AUTOSUSPEND_PEAK 0.00035565046709962195 // = db2gain(MIN_DB_A_LITTLE_BIT_ABOVE)

#define MIN_NONSILENT_PEAK (1000000.0f * 0.000000000000000000000000000000000000012207031820f) // I.e. 1000000 times size of largest denormal.


#if !defined(RELEASE)
Expand Down
2 changes: 1 addition & 1 deletion audio/SoundProducer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2384,7 +2384,7 @@ struct SoundProducer {
volume_peaks[ch] = out_peak;

#if 1
if (out_peak <= MIN_AUTOSUSPEND_PEAK)
if (out_peak <= MIN_NONSILENT_PEAK)
{
_curr_output_is_silent[ch] = true;
}
Expand Down

0 comments on commit db57fe0

Please sign in to comment.