mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
fix peak detection pseudo resampler
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2453 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
e35bae8a65
commit
6285a46935
1 changed files with 8 additions and 6 deletions
|
|
@ -1457,10 +1457,10 @@ static void peaks_resample(pa_resampler *r, const pa_memchunk *input, unsigned i
|
|||
r->peaks.max_i[c] = n;
|
||||
}
|
||||
|
||||
for (c = 0; c < r->o_ss.channels; c++, d++)
|
||||
for (c = 0; c < r->o_ss.channels; c++, d++) {
|
||||
*d = r->peaks.max_i[c];
|
||||
|
||||
memset(r->peaks.max_i, 0, sizeof(r->peaks.max_i));
|
||||
r->peaks.max_i[c] = 0;
|
||||
}
|
||||
} else {
|
||||
unsigned i, c;
|
||||
float *s = (float*) ((uint8_t*) src + fz * j);
|
||||
|
|
@ -1476,13 +1476,15 @@ static void peaks_resample(pa_resampler *r, const pa_memchunk *input, unsigned i
|
|||
r->peaks.max_f[c] = n;
|
||||
}
|
||||
|
||||
for (c = 0; c < r->o_ss.channels; c++, d++)
|
||||
for (c = 0; c < r->o_ss.channels; c++, d++) {
|
||||
*d = r->peaks.max_f[c];
|
||||
|
||||
memset(r->peaks.max_f, 0, sizeof(r->peaks.max_f));
|
||||
r->peaks.max_f[c] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
start = j+1;
|
||||
}
|
||||
|
||||
pa_memblock_release(input->memblock);
|
||||
pa_memblock_release(output->memblock);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue