Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#469 [readsf~] loops some files

closed-accepted
puredata (375)
5
2013-04-14
2012-11-08
No

some wav-files get looped when played back via [readsf~].

it seems that the problem is dues to the soundfile fitting exactly into the fifobuffer, thus the EOF (signalled by the read-thread) drain never really starts in the perform routine.
(fifohead==fifosize, so the test for (!x_eof && x_fifohead >= x_fifotail && x_fifohead < x_fifotail + wantbytes-1) never triggers, resulting in a continuous drain of the entire buffer.

the attached soundfile triggers this behaviour.

Discussion

  • attached is a simplistic attempt to fix the problem: if the fifohead==fifosize, we wrap it to 0 even if we just read the last byte. (originally this was only done if !EOF)

     


Anonymous


Cancel   Add attachments