mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
nist.c : Fix a bug where a variable was being used without being initialized.
This commit is contained in:
parent
1ae9d20e71
commit
567dab060c
@ -1,3 +1,8 @@
|
||||
2005-07-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* src/nist.c
|
||||
Fix a bug where a variable was being used without being initialized.
|
||||
|
||||
2005-07-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* src/common.h
|
||||
|
14
src/nist.c
14
src/nist.c
@ -72,6 +72,7 @@ nist_open (SF_PRIVATE *psf)
|
||||
psf->endian = (CPU_IS_BIG_ENDIAN) ? SF_ENDIAN_BIG : SF_ENDIAN_LITTLE ;
|
||||
|
||||
psf->blockwidth = psf->bytewidth * psf->sf.channels ;
|
||||
psf->sf.frames = 0 ;
|
||||
|
||||
if ((error = nist_write_header (psf, SF_FALSE)))
|
||||
return error ;
|
||||
@ -274,8 +275,17 @@ nist_write_header (SF_PRIVATE *psf, int calc_length)
|
||||
|
||||
current = psf_ftell (psf) ;
|
||||
|
||||
/* Prevent compiler warning. */
|
||||
calc_length = calc_length ;
|
||||
if (calc_length)
|
||||
{ psf->filelength = psf_get_filelen (psf) ;
|
||||
|
||||
psf->datalength = psf->filelength - psf->dataoffset ;
|
||||
|
||||
if (psf->dataend)
|
||||
psf->datalength -= psf->filelength - psf->dataend ;
|
||||
|
||||
if (psf->bytewidth > 0)
|
||||
psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ;
|
||||
} ;
|
||||
|
||||
if (psf->endian == SF_ENDIAN_BIG)
|
||||
end_str = "10" ;
|
||||
|
Loading…
Reference in New Issue
Block a user