|
From: Martin R. <ru...@us...> - 2007-11-07 20:28:18
|
Update of /cvsroot/foo/foo/libfoo/src
In directory sc8-pr-cvs17:/tmp/cvs-serv27344
Modified Files:
FOOSoundFile.m
Log Message:
fixed soundfile open bug when not using flac support
Index: FOOSoundFile.m
===================================================================
RCS file: /cvsroot/foo/foo/libfoo/src/FOOSoundFile.m,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** FOOSoundFile.m 4 Apr 2007 14:36:04 -0000 1.9
--- FOOSoundFile.m 7 Nov 2007 20:28:13 -0000 1.10
***************
*** 137,167 ****
cache handling needs read access to file */
#ifdef HAVE_SNDFILE_FLAC_SUPPORT
! if (! (_file = sf_open([_fileName cString], SFM_READ, &_fileInfo)))
! {
! fprintf(stderr, "libsndfile: %s\n", sf_strerror(_file));
! FOO_ERROR(YES, NO);
! }
! // flac ahead?
! if ((_fileInfo.format & SF_FORMAT_TYPEMASK) == SF_FORMAT_FLAC)
! {
! mode = SFM_WRITE;
! }
! else
! {
! mode = SFM_RDWR;
! _fileInfo.format = 0; // reset
! }
! if (sf_close(_file))
! {
! fprintf(stderr, "libsndfile: %s\n", sf_strerror(_file));
! FOO_ERROR(YES, NO);
! }
! _file = NULL;
! break;
#else // #ifdef HAVE_SNDFILE_FLAC_SUPPORT
! // mode = SFM_WRITE;
! break;
#endif // #ifdef HAVE_SNDFILE_FLAC_SUPPORT
--- 137,167 ----
cache handling needs read access to file */
#ifdef HAVE_SNDFILE_FLAC_SUPPORT
! if (! (_file = sf_open([_fileName cString], SFM_READ, &_fileInfo)))
! {
! fprintf(stderr, "libsndfile: %s\n", sf_strerror(_file));
! FOO_ERROR(YES, NO);
! }
! // flac ahead?
! if ((_fileInfo.format & SF_FORMAT_TYPEMASK) == SF_FORMAT_FLAC)
! {
! mode = SFM_WRITE;
! }
! else
! {
! mode = SFM_RDWR;
! _fileInfo.format = 0; // reset
! }
! if (sf_close(_file))
! {
! fprintf(stderr, "libsndfile: %s\n", sf_strerror(_file));
! FOO_ERROR(YES, NO);
! }
! _file = NULL;
! break;
#else // #ifdef HAVE_SNDFILE_FLAC_SUPPORT
! mode = SFM_RDWR;
! break;
#endif // #ifdef HAVE_SNDFILE_FLAC_SUPPORT
|