aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Blechmann <timblech@users.sourceforge.net>2005-10-23 22:04:51 +0000
committerIOhannes m zmölnig <zmoelnig@iem.at>2015-10-14 15:12:00 +0200
commit9290c9a11f4aea63431c62b3f21b9d59d015bff9 (patch)
tree06423c4af8c6509c4ced0df53a0c23e7411ce1b5
parentef53e19b3d9019b1b1f3345390f55ae9229ce390 (diff)
multichannel fix
svn path=/trunk/externals/tb/; revision=3761
-rw-r--r--sndfiler/sndfiler.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sndfiler/sndfiler.c b/sndfiler/sndfiler.c
index 29c692a..c9e0fb4 100644
--- a/sndfiler/sndfiler.c
+++ b/sndfiler/sndfiler.c
@@ -221,6 +221,7 @@ static void sndfiler_read_cb(t_sndfiler * x, int argc, t_atom* argv)
t_float * item = alloca(maxchannels * sizeof(t_float));
+
t_int ** syncdata = getbytes(sizeof(t_int*) * 5);
#if (_POSIX_MEMLOCK - 0) >= 200112L
@@ -235,14 +236,14 @@ static void sndfiler_read_cb(t_sndfiler * x, int argc, t_atom* argv)
for (i = 0; i != info.frames; ++i)
{
- sf_read_float(sndfile, item, 1);
+ sf_read_float(sndfile, item, info.channels);
- for (j = 0; j != channel_count; ++j)
+ for (j = 0; j != info.channels; ++j)
{
- if (j < minchannels)
+ if (j < channel_count)
+ {
helper_arrays[j][i] = item[j];
- else
- helper_arrays[j][i] = 0;
+ }
}
}
#if (_POSIX_MEMLOCK - 0) >= 200112L