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

Modified Files:
        Import.cpp 
Log Message:
-Check for unsupported extensions before trying to open file of unknown type.

Index: Import.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/import/Import.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- Import.cpp  5 Aug 2007 10:28:24 -0000       1.32
+++ Import.cpp  22 Aug 2007 15:48:59 -0000      1.33
@@ -141,38 +141,6 @@
       importPluginNode = importPluginNode->GetNext();
    }
 
-   // no importPlugin that recognized the extension succeeded.  However, the
-   // file might be misnamed.  So this time we try all the importPlugins
-   //in order and see if any of them can handle the file
-   importPluginNode = mImportPluginList->GetFirst();
-   while(importPluginNode)
-   {
-      ImportPlugin *plugin = importPluginNode->GetData();
-
-      mInFile = plugin->Open(fName);
-      if( mInFile != NULL )
-      {
-         mInFile->SetProgressCallback(progressCallback, userData);
-         numTracks = 0;
-         if(mInFile->Import(trackFactory, tracks, &numTracks, tags))
-         {
-            if (numTracks > 0) {
-               // success!
-               delete mInFile;
-               return numTracks;
-            }
-         }
-         delete mInFile;
-
-         // This will happen if the user cancelled, or if we
-         // tried and got an error partially through.  Either way,
-         // no need to try any other formats at this point!
-         if (numTracks > 0)
-            return 0;
-      }
-      importPluginNode = importPluginNode->GetNext();
-   }
-
    // None of our plugins can handle this file.  It might be that
    // Audacity supports this format, but support was not compiled in.
    // If so, notify the user of this fact
@@ -231,6 +199,40 @@
       return 0;
    }
 
+
+   // no importPlugin that recognized the extension succeeded.  However, the
+   // file might be misnamed.  So this time we try all the importPlugins
+   //in order and see if any of them can handle the file
+   importPluginNode = mImportPluginList->GetFirst();
+   while(importPluginNode)
+   {
+      ImportPlugin *plugin = importPluginNode->GetData();
+
+      mInFile = plugin->Open(fName);
+      if( mInFile != NULL )
+      {
+         mInFile->SetProgressCallback(progressCallback, userData);
+         numTracks = 0;
+         if(mInFile->Import(trackFactory, tracks, &numTracks, tags))
+         {
+            if (numTracks > 0) {
+               // success!
+               delete mInFile;
+               errorMessage = _( "Audacity had to make a guess at the type of 
file.\nThe Audio may be bogus.\n\nIf the audio is bogus, try renaming the 
file\nso that it has the correct extension before opening it.");
+               return numTracks;
+            }
+         }
+         delete mInFile;
+
+         // This will happen if the user cancelled, or if we
+         // tried and got an error partially through.  Either way,
+         // no need to try any other formats at this point!
+         if (numTracks > 0)
+            return 0;
+      }
+      importPluginNode = importPluginNode->GetNext();
+   }
+
    // we were not able to recognize the file type
    errorMessage = _("Audacity did not recognize the type of this file.\nIf it 
is uncompressed, try importing it using \"Import Raw\"" );
    return 0;


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to