avfilter/silenceremove_template: improve ptp detector

This commit is contained in:
Paul B Mahol 2023-05-28 14:24:07 +02:00
parent e71cd18049
commit 364c03d9fe
1 changed files with 2 additions and 2 deletions

View File

@ -286,8 +286,8 @@ static ftype fn(compute_ptp)(ftype *peak, ftype sample, ftype wsample,
peak[back] = sample;
max = peak[front];
min = (back == front) ? -sample : sample;
r = FABS(max - min);
min = sample;
r = FABS(min) + FABS(max - min);
*ffront = front;
*bback = back;