Add a simple pseudo-random throttle to keep the rate of corrections below 1:1000 on average -- that is, about 1 packet in three may be interpolated.
This commit is contained in:
@@ -750,6 +750,13 @@ static void *player_thread_func(void *arg) {
|
||||
// debug(1,"DAC buffer too short to allow stuffing.");
|
||||
amount_to_stuff=0;
|
||||
}
|
||||
|
||||
// try to keep the corrections definitely below 1 in 1000 audio frames
|
||||
if (amount_to_stuff) {
|
||||
uint32_t x = random()%1000;
|
||||
if (x>352)
|
||||
amount_to_stuff=0;
|
||||
}
|
||||
|
||||
if ((amount_to_stuff==0) && (fix_volume==0x10000)) {
|
||||
// if no stuffing needed and no volume adjustment, then
|
||||
|
||||
Reference in New Issue
Block a user