mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-20 21:47:39 -04:00
pdbox: Solved issue with WAV file import on big-endian targets (signed 16-bit files only); small I/O-related workaround in g_array.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26439 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dc496d6fbe
commit
a266ff185a
2 changed files with 9 additions and 2 deletions
|
@ -423,7 +423,14 @@ static void soundfile_xferin(int sfchannels, int nvecs, t_sample **vecs,
|
|||
{
|
||||
for (j = 0, sp2 = sp, fp=vecs[i] + itemsread;
|
||||
j < nitems; j++, sp2 += bytesperframe, fp++)
|
||||
#ifdef ROCKBOX_BIG_ENDIAN
|
||||
{
|
||||
short xx = (sp2[1] << 8) | sp2[0];
|
||||
*fp = xx << (fix1-16);
|
||||
}
|
||||
#else
|
||||
*fp = ((short*)sp2)[0]<<(fix1-16);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (bytespersamp == 3)
|
||||
|
|
|
@ -1154,7 +1154,7 @@ static void garray_read(t_garray *x, t_symbol *filename)
|
|||
canvas_getdir(glist_getcanvas(x->x_glist))->s_name,
|
||||
filename->s_name, "", buf, &bufptr, MAXPDSTRING, 0)) < 0
|
||||
#ifdef ROCKBOX
|
||||
)
|
||||
|| !(fd = filedesc))
|
||||
#else
|
||||
|| !(fd = fdopen(filedesc, "r")))
|
||||
#endif
|
||||
|
@ -1234,7 +1234,7 @@ static void garray_read16(t_garray *x, t_symbol *filename,
|
|||
canvas_getdir(glist_getcanvas(x->x_glist))->s_name,
|
||||
filename->s_name, "", buf, &bufptr, MAXPDSTRING, 1)) < 0
|
||||
#ifdef ROCKBOX
|
||||
)
|
||||
|| !(fd = filedesc))
|
||||
#else
|
||||
|| !(fd = fdopen(filedesc, BINREADMODE)))
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue