Update of /cvsroot/audacity/audacity-src/src/blockfile
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv32078/blockfile

Modified Files:
      Tag: AUDACITY_1_2
        LegacyBlockFile.cpp PCMAliasBlockFile.cpp SimpleBlockFile.cpp 
Log Message:
Fix potential crash on Mac caused by non-thread-safe utf8-conversion system 
call.  Now filename conversion calls are computed once and cached for filenames 
that might be accessed from the other thread.

Index: LegacyBlockFile.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/blockfile/LegacyBlockFile.cpp,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -u -d -r1.8.2.1 -r1.8.2.2
--- LegacyBlockFile.cpp 12 Jan 2007 00:27:43 -0000      1.8.2.1
+++ LegacyBlockFile.cpp 26 Feb 2007 10:17:09 -0000      1.8.2.2
@@ -181,7 +181,7 @@
    info.frames = mLen + (mSummaryInfo.totalSummaryBytes /
                          SAMPLE_SIZE(mFormat));
    
-   SNDFILE *sf = sf_open(FILENAME(mFileName.GetFullPath()), SFM_READ, &info);
+   SNDFILE *sf = sf_open(mFullPath, SFM_READ, &info);
 
    if (!sf)
       return 0;

Index: SimpleBlockFile.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/blockfile/SimpleBlockFile.cpp,v
retrieving revision 1.8.2.3
retrieving revision 1.8.2.4
diff -u -d -r1.8.2.3 -r1.8.2.4
--- SimpleBlockFile.cpp 12 Jan 2007 00:27:48 -0000      1.8.2.3
+++ SimpleBlockFile.cpp 26 Feb 2007 10:17:09 -0000      1.8.2.4
@@ -47,12 +47,12 @@
                                  sampleFormat format):
    BlockFile(wxFileName(baseFileName.GetFullPath() + ".au"), sampleLen)
 {
-   wxASSERT( !wxFileExists(FILENAME(mFileName.GetFullPath())) );
+   wxASSERT(!wxFileExists(mFullPath));
 
    // Open and write the file
    wxFFile file;
 
-   if( !file.Open((const wxChar *)FILENAME(mFileName.GetFullPath()), "wb") )
+   if( !file.Open(mFullPath, "wb") )
        // Throw an exception?
        return;
 
@@ -150,7 +150,7 @@
 {
    wxFFile file;
 
-   if( !file.Open((const wxChar *)FILENAME(mFileName.GetFullPath()), "rb") )
+   if( !file.Open(mFullPath, "rb") )
       return false;
 
    // The offset is just past the au header
@@ -177,7 +177,7 @@
    SF_INFO info;
 
    memset(&info, 0, sizeof(info));
-   SNDFILE *sf = sf_open(FILENAME(mFileName.GetFullPath()), SFM_READ, &info);
+   SNDFILE *sf = sf_open(mFullPath, SFM_READ, &info);
 
    if (!sf)
       return 0;

Index: PCMAliasBlockFile.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/blockfile/PCMAliasBlockFile.cpp,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -u -d -r1.4.2.3 -r1.4.2.4
--- PCMAliasBlockFile.cpp       12 Jan 2007 00:27:44 -0000      1.4.2.3
+++ PCMAliasBlockFile.cpp       26 Feb 2007 10:17:09 -0000      1.4.2.4
@@ -52,7 +52,7 @@
 
    memset(&info, 0, sizeof(info));
 
-   SNDFILE *sf = sf_open(FILENAME(mAliasedFileName.GetFullPath()), SFM_READ, 
&info);
+   SNDFILE *sf = sf_open(mAliasedFullPath, SFM_READ, &info);
    if (!sf)
       return 0;
 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to