Skip to content

Commit

Permalink
Resampler: Consistently use signed ints.
Browse files Browse the repository at this point in the history
  • Loading branch information
bearoso committed Oct 11, 2023
1 parent 58bdb3e commit 94125d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apu/resampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ class Resampler
r_right[0] = r_right[1] = r_right[2] = r_right[3] = 0;
}

inline void dump(unsigned int num_samples)
inline void dump(int num_samples)
{
if ((unsigned int)space_filled() >= num_samples)
if (num_samples > 0 && space_filled() >= num_samples)
start = (start + num_samples) % buffer_size;
}

inline void add_silence(unsigned int num_samples)
inline void add_silence(int num_samples)
{
if (space_empty() < num_samples)
if (num_samples > 0 && space_empty() < num_samples)
return;

int first_block_size = min(num_samples, buffer_size - end);
Expand Down

0 comments on commit 94125d4

Please sign in to comment.