1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 08:04:49 -05:00

Merge pull request #2226 from jfdelnero/master

Fix audio glitches in the DAB plugin
This commit is contained in:
Edouard Griffiths 2024-08-02 18:56:01 +02:00 committed by GitHub
commit ff7c06311b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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); int32_t prod = (int32_t)(((int32_t)sample) * factor);
prod = std::min(prod, 32767); prod = std::min(prod, 32767);
@ -403,7 +403,12 @@ void DABDemodSink::audio(int16_t *buffer, int size, int samplerate, bool stereo)
ci.real(0.0f); ci.real(0.0f);
ci.imag(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)) while (!m_audioInterpolator.interpolate(&m_audioInterpolatorDistanceRemain, ci, &ca))
{ {