Fix parsing of 'PAD ' chunk of WAV files.

'PAD ' chunk fix was really a problem with header_seek in common.c.
Minor improvements to sndfile.pc.in and NEWS files.
This commit is contained in:
Erik de Castro Lopo 2004-02-15 02:30:33 +00:00
parent bad679cfdd
commit a8a36a0843
4 changed files with 9 additions and 12 deletions

4
NEWS
View File

@ -1,7 +1,7 @@
Version 1.0.6 (2004-02-08)
* Added support for native Win32 file access API (Ross Bencina).
* New mode to add clippling then a converstion from float/double to
integer would otherwise wrap around.
* New mode to add clippling then a converting from float/double to integer
would otherwise wrap around.
* Fixed a bug in reading/writing files > 2Gig on Linux, Solaris and others.
* Many minor bug fixes.
* Other random fixes for Win32.

View File

@ -4,7 +4,7 @@ libdir=@libdir@
includedir=@includedir@
Name: sndfile
Description: A library for reading and writing audio files.
Description: A library for reading and writing audio files
Requires:
Version: @VERSION@
Libs: -L${libdir} -lsndfile

View File

@ -737,7 +737,7 @@ header_read (SF_PRIVATE *psf, void *ptr, int bytes)
return 0;
printf ("\nR sizeof (header): %u headindex: %4u bytes: %d\n", sizeof (psf->header), psf->headindex, bytes) ;
} ;
if (psf->headindex + bytes > psf->headend)
{ count = psf_fread (psf->header + psf->headend, 1, bytes - (psf->headend - psf->headindex), psf) ;
@ -762,13 +762,11 @@ header_seek (SF_PRIVATE *psf, sf_count_t position, int whence)
if (position > sizeof (psf->header))
{ /* Too much header to cache so just seek instead. */
psf_fseek (psf, position, whence) ;
//printf ("A sizeof (header): %u headindex: %4u\n", sizeof (psf->header), psf->headindex) ;
return ;
} ;
if (position > psf->headend)
psf->headend += psf_fread (psf->header + psf->headend, 1, position - psf->headend, psf) ;
psf->headindex = position ;
//printf ("B sizeof (header): %u headindex: %4u\n", sizeof (psf->header), psf->headindex) ;
break ;
case SEEK_CUR :
@ -781,10 +779,9 @@ header_seek (SF_PRIVATE *psf, sf_count_t position, int whence)
} ;
if (psf->headindex + position > SIGNED_SIZEOF (psf->header))
{ psf->headend += psf_fread (psf->header + psf->headend, 1, SIGNED_SIZEOF (psf->header) - psf->headend, psf) ;
psf->headindex = psf->headend = SIGNED_SIZEOF (psf->header) ;
psf_fseek (psf, position - (SIGNED_SIZEOF (psf->header) - psf->headend), SEEK_CUR) ;
{ /* Need to jump this without caching it. */
psf->headindex = psf->headend ;
psf_fseek (psf, position, SEEK_CUR) ;
break ;
} ;
@ -1177,7 +1174,7 @@ u_bitwidth_to_subformat (int bits)
#endif /* PSF_LOG_PRINTF_ONLY */
/*
** Do not edit or modify anything in this comment block.
** The arch-tag line is a file identity tag for the GNU Arch
** The arch-tag line is a file identity tag for the GNU Arch
** revision control system.
**
** arch-tag: 33e9795e-f717-461a-9feb-65d083a56395

View File

@ -234,7 +234,7 @@ wav_read_header (SF_PRIVATE *psf, int *blockalign, int *framesperblock)
psf_log_printf (psf, "RIFF : %u\n", RIFFsize) ;
}
else if (psf->filelength < RIFFsize + 2 * SIGNED_SIZEOF (dword))
{ psf_log_printf (psf, "RIFF : %u (should be %D)\n", (sf_count_t) RIFFsize, psf->filelength - 2 * SIGNED_SIZEOF (dword)) ;
{ psf_log_printf (psf, "RIFF : %u (should be %D)\n", RIFFsize, psf->filelength - 2 * SIGNED_SIZEOF (dword)) ;
RIFFsize = dword ;
}
else if (RIFFsize < 100)