Bugs item #3594822, was opened at 2012-12-11 08:50
Message generated for change (Tracker Item Submitted) made by tschmula
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110706&aid=3594822&group_id=10706

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: MrMod (tschmula)
Assigned to: Nobody/Anonymous (nobody)
Summary: Same bug as 3592482 also found in dft_filter and tempo

Initial Comment:
Today I tried a different upconversion method and found the same hang condition 
when using the sinc filter. To reproduce:
SoX -V -S -r 192000 -b 24 -n -n synth 3:15:00 pinknoise sinc -a 40 -t 8k -24k

So, I searched through all the SoX code and found the same bug as 3592482 in 
the dft_filter.c and tempo.c files.  Here is the patch file I used to fix my 
version:
*** sox-14.4.0/src/dft_filter.c Wed Mar  2 19:47:52 2011
--- sox-14.4.0-update/src/dft_filter.c  Tue Dec 11 11:25:29 2012
***************
*** 108,114 ****
    size_t remaining = samples_out - p->samples_out;
    double * buff = lsx_calloc(1024, sizeof(*buff));
  
!   if ((int)remaining > 0) {
      while ((size_t)fifo_occupancy(&p->output_fifo) < remaining) {
        fifo_write(&p->input_fifo, 1024, buff);
        p->samples_in += 1024;
--- 108,114 ----
    size_t remaining = samples_out - p->samples_out;
    double * buff = lsx_calloc(1024, sizeof(*buff));
  
!   if (samples_out > p->samples_out) {
      while ((size_t)fifo_occupancy(&p->output_fifo) < remaining) {
        fifo_write(&p->input_fifo, 1024, buff);
        p->samples_in += 1024;
*** sox-14.4.0/src/tempo.c      Sat Jan 21 16:33:13 2012
--- sox-14.4.0-update/src/tempo.c       Tue Dec 11 11:34:31 2012
***************
*** 151,162 ****
    size_t remaining = samples_out - t->samples_out;
    float * buff = lsx_calloc(128 * t->channels, sizeof(*buff));
  
!   if ((int)remaining > 0) {
      while (fifo_occupancy(&t->output_fifo) < remaining) {
        tempo_input(t, buff, (size_t) 128);
        tempo_process(t);
      }
!     fifo_trim_to(&t->output_fifo, remaining);
      t->samples_in = 0;
    }
    free(buff);
--- 151,162 ----
    size_t remaining = samples_out - t->samples_out;
    float * buff = lsx_calloc(128 * t->channels, sizeof(*buff));
  
!   if (samples_out > t->samples_out) {
      while (fifo_occupancy(&t->output_fifo) < remaining) {
        tempo_input(t, buff, (size_t) 128);
        tempo_process(t);
      }
!     fifo_trim_to(&t->output_fifo, (int)remaining);
      t->samples_in = 0;
    }
    free(buff);

The tempo.c patch also includes the (int)remaining cast for the fifo_trim_to 
function.

Sincerely,
MrMod

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110706&aid=3594822&group_id=10706

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

Reply via email to