summaryrefslogtreecommitdiff
path: root/apps/plugins/pdbox/PDa/src/d_soundfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pdbox/PDa/src/d_soundfile.c')
-rw-r--r--apps/plugins/pdbox/PDa/src/d_soundfile.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/apps/plugins/pdbox/PDa/src/d_soundfile.c b/apps/plugins/pdbox/PDa/src/d_soundfile.c
index 479655f807..67a80c9d3a 100644
--- a/apps/plugins/pdbox/PDa/src/d_soundfile.c
+++ b/apps/plugins/pdbox/PDa/src/d_soundfile.c
@@ -1118,9 +1118,7 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s,
1118 if (finalsize > bytelimit / (channels * bytespersamp)) 1118 if (finalsize > bytelimit / (channels * bytespersamp))
1119 finalsize = bytelimit / (channels * bytespersamp); 1119 finalsize = bytelimit / (channels * bytespersamp);
1120#ifdef ROCKBOX 1120#ifdef ROCKBOX
1121 fp = open_soundfile(canvas_getdir(x->x_canvas)->s_name, filename, 1121 fp = fd;
1122 headersize, &bytespersamp, &bigendian, &channels, &bytelimit,
1123 skipframes);
1124#else 1122#else
1125 fp = fdopen(fd, "rb"); 1123 fp = fdopen(fd, "rb");
1126#endif 1124#endif
@@ -1131,7 +1129,7 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s,
1131 int thisread = finalsize - itemsread; 1129 int thisread = finalsize - itemsread;
1132 thisread = (thisread > bufframes ? bufframes : thisread); 1130 thisread = (thisread > bufframes ? bufframes : thisread);
1133#ifdef ROCKBOX 1131#ifdef ROCKBOX
1134 nitems = read(fp, sampbuf, thisread * bytespersamp * channels); 1132 nitems = read(fp, sampbuf, thisread * bytespersamp * channels) / bytespersamp;
1135#else 1133#else
1136 nitems = fread(sampbuf, channels * bytespersamp, thisread, fp); 1134 nitems = fread(sampbuf, channels * bytespersamp, thisread, fp);
1137#endif 1135#endif
@@ -1141,7 +1139,7 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s,
1141 itemsread += nitems; 1139 itemsread += nitems;
1142 } 1140 }
1143 /* zero out remaining elements of vectors */ 1141 /* zero out remaining elements of vectors */
1144 1142
1145 for (i = 0; i < argc; i++) 1143 for (i = 0; i < argc; i++)
1146 { 1144 {
1147#ifdef ROCKBOX 1145#ifdef ROCKBOX