Skip to content

Commit

Permalink
Merge pull request #2226 from jfdelnero/master
Browse files Browse the repository at this point in the history
 Fix audio glitches in the DAB plugin
  • Loading branch information
f4exb authored Aug 2, 2024
2 parents 78b73ae + 5888645 commit ff7c063
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/channelrx/demoddab/dabdemodsink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ void DABDemodSink::tii(int tii)
}
}

static int16_t scale(int16_t sample, float factor)
static int16_t scale(Real sample, float factor)
{
int32_t prod = (int32_t)(((int32_t)sample) * factor);
prod = std::min(prod, 32767);
Expand Down Expand Up @@ -403,7 +403,12 @@ void DABDemodSink::audio(int16_t *buffer, int size, int samplerate, bool stereo)
ci.real(0.0f);
ci.imag(0.0f);
}
if (m_audioInterpolatorDistance < 1.0f) // interpolate

if (m_audioInterpolatorDistance == 1.0f)
{
processOneAudioSample(ci);
}
else if (m_audioInterpolatorDistance < 1.0f) // interpolate
{
while (!m_audioInterpolator.interpolate(&m_audioInterpolatorDistanceRemain, ci, &ca))
{
Expand Down

0 comments on commit ff7c063

Please sign in to comment.