src/sndfile.c : Make sure psf->have_written gets set correctly in mode SFM_RDWR.

This commit is contained in:
Erik de Castro Lopo 2008-08-17 12:53:21 +10:00
parent 5506f2e2f3
commit 63f389b20b
2 changed files with 8 additions and 1 deletions

View File

@ -9,6 +9,9 @@
* src/wav.c
Fix to WAV parser to allow 'bext' chunk to be updated in place.
* src/sndfile.c
Make sure psf->have_written gets set correctly in mode SFM_RDWR.
2008-08-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* configure.ac

View File

@ -2716,7 +2716,11 @@ psf_open_file (SF_PRIVATE *psf, int mode, SF_INFO *sfinfo)
} ;
psf->read_current = 0 ;
psf->write_current = (psf->mode == SFM_RDWR) ? psf->sf.frames : 0 ;
psf->write_current = 0 ;
if (psf->mode == SFM_RDWR)
{ psf->write_current = psf->sf.frames ;
psf->have_written = psf->sf.frames > 0 ? SF_TRUE : SF_FALSE ;
} ;
memcpy (sfinfo, &(psf->sf), sizeof (SF_INFO)) ;