diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2008-05-28 17:26:30 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2008-05-28 17:26:30 +0000 |
commit | a1f4e7ea4d857f087313e8c105c8af6625dc0645 (patch) | |
tree | f4aabf16adc568e961735627ceb50a4751a600a8 /third_party/resample/src/resamplesubs.c | |
parent | 2ac219d1142aaa235ae786d1eac8b4a9383170e3 (diff) |
Reapplied changeset 287 (resample may write pass the output buffer), with a bit optimization
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1968 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'third_party/resample/src/resamplesubs.c')
-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 2cb04eb5..51648aea 100644 --- a/third_party/resample/src/resamplesubs.c +++ b/third_party/resample/src/resamplesubs.c @@ -259,7 +259,11 @@ static int SrcUp(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 */ /* Perform left-wing inner product */ |