From: robs <ro...@us...> - 2011-12-29 14:44:21
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "sox". The branch, master has been updated via c087ed916c26e51986bd2b17df57d98988435427 (commit) from 41bb7cc1dd2f4ec895d9ef7340534eec236e3270 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c087ed916c26e51986bd2b17df57d98988435427 Author: Rob Sykes <ro...@us...> Date: Thu Dec 29 14:42:31 2011 +0000 fix bug when fading out immediately after fading in could fail due to rounding to integer numbers of samples diff --git a/src/fade.c b/src/fade.c index 7d31084..5d5c832 100644 --- a/src/fade.c +++ b/src/fade.c @@ -170,17 +170,19 @@ static int sox_fade_start(sox_effect_t * effp) */ fade->out_stop = 0; - /* Sanity check for fade times vs total time */ - if (fade->in_stop > fade->out_start && fade->out_start != 0) - { /* Fades too long */ - lsx_fail("Fade: End of fade-in should not happen before beginning of fade-out"); - return(SOX_EOF); - } /* endif fade time sanity */ + if (fade->out_start) { /* Sanity check */ + if (fade->in_stop > fade->out_start) + --fade->in_stop; /* 1 sample grace for rounding error. */ + if (fade->in_stop > fade->out_start) { + lsx_fail("fade-out overlaps fade-in"); + return SOX_EOF; + } + } fade->samplesdone = fade->in_start; fade->endpadwarned = 0; - lsx_debug("fade: in_start = %lu in_stop = %lu out_start = %lu out_stop = %lu", (unsigned long)fade->in_start, (unsigned long)fade->in_stop, (unsigned long)fade->out_start, (unsigned long)fade->out_stop); + lsx_debug("in_start = %lu in_stop = %lu out_start = %lu out_stop = %lu", (unsigned long)fade->in_start, (unsigned long)fade->in_stop, (unsigned long)fade->out_start, (unsigned long)fade->out_stop); if (fade->in_start == fade->in_stop && !truncate && fade->out_start == fade->out_stop) ----------------------------------------------------------------------- Summary of changes: src/fade.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) hooks/post-receive -- sox |