src/wav.c : When writing loop lengths, adjust the end position by one to make up for Microsoft's screwed up spec.

This commit is contained in:
Erik de Castro Lopo 2009-10-18 19:49:41 +11:00
parent f909407d40
commit 10bd968638
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2009-10-18 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/wav.c
When writing loop lengths, adjust the end position by one to make up for
Microsoft's screwed up spec. Thanks to Olivier Tristan for the patch.
2009-10-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/flac.c

View File

@ -1097,7 +1097,7 @@ wav_write_header (SF_PRIVATE *psf, int calc_length)
type = (type == SF_LOOP_FORWARD ? 0 : type==SF_LOOP_BACKWARD ? 2 : type == SF_LOOP_ALTERNATING ? 1 : 32) ;
psf_binheader_writef (psf, "44", tmp, type) ;
psf_binheader_writef (psf, "44", psf->instrument->loops [tmp].start, psf->instrument->loops [tmp].end) ;
psf_binheader_writef (psf, "44", psf->instrument->loops [tmp].start, psf->instrument->loops [tmp].end - 1) ;
psf_binheader_writef (psf, "44", 0, psf->instrument->loops [tmp].count) ;
} ;
} ;
@ -1503,7 +1503,7 @@ wav_read_smpl_chunk (SF_PRIVATE *psf, unsigned int chunklen)
if (j < ARRAY_LEN (psf->instrument->loops))
{ psf->instrument->loops [j].start = start ;
psf->instrument->loops [j].end = end ;
psf->instrument->loops [j].end = end + 1 ;
psf->instrument->loops [j].count = count ;
switch (type)