diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2008-05-28 19:15:31 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2008-05-28 19:15:31 +0000 |
commit | f6d32199ffa340dbbc4f5cdb2869ea3f30fd2529 (patch) | |
tree | c54fe43d95d5b9f7490687d3a167df584af602cc /third_party | |
parent | a1f4e7ea4d857f087313e8c105c8af6625dc0645 (diff) |
More ticket #536: fixed bug in SrcUD (missed fix, previously r1968 only fixed SrcUp)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1969 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/resample/src/resamplesubs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/third_party/resample/src/resamplesubs.c b/third_party/resample/src/resamplesubs.c index 51648aea..242844d5 100644 --- a/third_party/resample/src/resamplesubs.c +++ b/third_party/resample/src/resamplesubs.c @@ -307,7 +307,11 @@ static int SrcUD(const RES_HWORD X[], RES_HWORD Y[], double pFactor, Ystart = Y; Yend = Ystart + (unsigned)(nx * pFactor); endTime = time + (1<<Np)*(RES_WORD)nx; - while (time < endTime) + + // Integer round down in dtb calculation may cause (endTime % dtb > 0), + // so it may cause resample write pass the output buffer (Y >= Yend). + // while (time < endTime) + while (Y < Yend) { xp = &X[time>>Np]; /* Ptr to current input sample */ v = FilterUD(pImp, pImpD, pNwing, Interp, xp, (RES_HWORD)(time&Pmask), |