mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
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:
parent
bad679cfdd
commit
a8a36a0843
4
NEWS
4
NEWS
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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 ;
|
||||
} ;
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user