Permalink
Browse files

o work around broken files - don't endlessloop :)

  • Loading branch information...
1 parent 78e66dd commit 9c0ba158a97a985819e6c6f1cc30d6ea2d35c70d @hzeller committed Sep 15, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 convolver.cc
View
@@ -295,6 +295,14 @@ class SndFileHandler :
zita_.convproc->start_process(0, 0);
}
int r = sf_readf_float(snd_in_, raw_sample_buffer_, zita_.fragm);
+ if (r == 0) {
+ LOG_ERROR(stderr, "Expected %d frames left, gave buffer sized %d, "
+ "but got EOF; corrupt file '%s' ?\n",
+ input_frames_left_, zita_.fragm, file_name_.c_str());
+ input_frames_left_ = 0;
+ Close();
+ return false;
+ }
if (r < (int) zita_.fragm) {
// Zero out the rest of the buffer.
const int missing = zita_.fragm - r;

0 comments on commit 9c0ba15

Please sign in to comment.