forked from len0rd/rockbox
Committing fix for FS#12249. Patch by Buschel. Further fixes for AIFF loader in PDBox in the future.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30944 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
32eb8275f4
commit
d01954cad2
1 changed files with 13 additions and 11 deletions
|
@ -683,8 +683,9 @@ static int create_soundfile(t_canvas *canvas, const char *filename,
|
||||||
{
|
{
|
||||||
long datasize = nframes * nchannels * bytespersamp;
|
long datasize = nframes * nchannels * bytespersamp;
|
||||||
long longtmp;
|
long longtmp;
|
||||||
static unsigned char dogdoo[] =
|
t_datachunk *aiffdc = (t_datachunk *)headerbuf + sizeof(t_aiff);
|
||||||
{0x40, 0x0e, 0xac, 0x44, 0, 0, 0, 0, 0, 0, 'S', 'S', 'N', 'D'};
|
static unsigned char AIFF_splrate[] = {0x40, 0x0e, 0xac, 0x44, 0, 0, 0, 0, 0, 0};
|
||||||
|
static unsigned char datachunk_ID[] = {'S', 'S', 'N', 'D'};
|
||||||
if (strcmp(filenamebuf + strlen(filenamebuf)-4, ".aif") &&
|
if (strcmp(filenamebuf + strlen(filenamebuf)-4, ".aif") &&
|
||||||
strcmp(filenamebuf + strlen(filenamebuf)-5, ".aiff"))
|
strcmp(filenamebuf + strlen(filenamebuf)-5, ".aiff"))
|
||||||
strcat(filenamebuf, ".aif");
|
strcat(filenamebuf, ".aif");
|
||||||
|
@ -697,9 +698,10 @@ static int create_soundfile(t_canvas *canvas, const char *filename,
|
||||||
longtmp = swap4(nframes, swap);
|
longtmp = swap4(nframes, swap);
|
||||||
memcpy(&aiffhdr->a_nframeshi, &longtmp, 4);
|
memcpy(&aiffhdr->a_nframeshi, &longtmp, 4);
|
||||||
aiffhdr->a_bitspersamp = swap2(8 * bytespersamp, swap);
|
aiffhdr->a_bitspersamp = swap2(8 * bytespersamp, swap);
|
||||||
memcpy(aiffhdr->a_samprate, dogdoo, sizeof(dogdoo));
|
memcpy(aiffhdr->a_samprate, AIFF_splrate, sizeof(AIFF_splrate));
|
||||||
|
memcpy(aiffdc->dc_id, datachunk_ID, sizeof(datachunk_ID));
|
||||||
longtmp = swap4(datasize, swap);
|
longtmp = swap4(datasize, swap);
|
||||||
memcpy(aiffhdr->a_samprate + sizeof(dogdoo), &longtmp, 4);
|
memcpy(&aiffdc->dc_size, &longtmp, 4);
|
||||||
headersize = AIFFPLUS;
|
headersize = AIFFPLUS;
|
||||||
}
|
}
|
||||||
else /* WAVE format */
|
else /* WAVE format */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue