forked from len0rd/rockbox
pdbox: Fixed loading of sound files, pdpod_drums.pd works now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25769 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2788f8dd5d
commit
a607a6c3c2
1 changed files with 3 additions and 5 deletions
|
@ -1118,9 +1118,7 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s,
|
||||||
if (finalsize > bytelimit / (channels * bytespersamp))
|
if (finalsize > bytelimit / (channels * bytespersamp))
|
||||||
finalsize = bytelimit / (channels * bytespersamp);
|
finalsize = bytelimit / (channels * bytespersamp);
|
||||||
#ifdef ROCKBOX
|
#ifdef ROCKBOX
|
||||||
fp = open_soundfile(canvas_getdir(x->x_canvas)->s_name, filename,
|
fp = fd;
|
||||||
headersize, &bytespersamp, &bigendian, &channels, &bytelimit,
|
|
||||||
skipframes);
|
|
||||||
#else
|
#else
|
||||||
fp = fdopen(fd, "rb");
|
fp = fdopen(fd, "rb");
|
||||||
#endif
|
#endif
|
||||||
|
@ -1131,7 +1129,7 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s,
|
||||||
int thisread = finalsize - itemsread;
|
int thisread = finalsize - itemsread;
|
||||||
thisread = (thisread > bufframes ? bufframes : thisread);
|
thisread = (thisread > bufframes ? bufframes : thisread);
|
||||||
#ifdef ROCKBOX
|
#ifdef ROCKBOX
|
||||||
nitems = read(fp, sampbuf, thisread * bytespersamp * channels);
|
nitems = read(fp, sampbuf, thisread * bytespersamp * channels) / bytespersamp;
|
||||||
#else
|
#else
|
||||||
nitems = fread(sampbuf, channels * bytespersamp, thisread, fp);
|
nitems = fread(sampbuf, channels * bytespersamp, thisread, fp);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue