Update of /cvsroot/audacity/audacity-src/src/blockfile In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12559
Modified Files: PCMAliasBlockFile.cpp Log Message: f.Open was causing a hang if the file didn't exist, so check for existance first. Index: PCMAliasBlockFile.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/blockfile/PCMAliasBlockFile.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- PCMAliasBlockFile.cpp 14 Aug 2009 17:10:22 -0000 1.18 +++ PCMAliasBlockFile.cpp 2 Jan 2010 21:46:22 -0000 1.19 @@ -80,22 +80,21 @@ wxFile f; // will be closed when it goes out of scope SNDFILE *sf = NULL; - if (f.Open(mAliasedFileName.GetFullPath())) { - // Even though there is an sf_open() that takes a filename, use the one that - // takes a file descriptor since wxWidgets can open a file with a Unicode name and - // libsndfile can't (under Windows). - ODManager::LockLibSndFileMutex(); - sf = sf_open_fd(f.fd(), SFM_READ, &info, FALSE); - ODManager::UnlockLibSndFileMutex(); + if (f.Exists(mAliasedFileName.GetFullPath())) { // Don't use Open if file does not exits + if (f.Open(mAliasedFileName.GetFullPath())) { + // Even though there is an sf_open() that takes a filename, use the one that + // takes a file descriptor since wxWidgets can open a file with a Unicode name and + // libsndfile can't (under Windows). + ODManager::LockLibSndFileMutex(); + sf = sf_open_fd(f.fd(), SFM_READ, &info, FALSE); + ODManager::UnlockLibSndFileMutex(); + } } if (!sf){ - memset(data,0,SAMPLE_SIZE(format)*len); - if(silence) delete silence; mSilentAliasLog=TRUE; - return len; } ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Audacity-cvs mailing list Audacity-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/audacity-cvs