mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
Fix invalid error message when selecting directories/folders in Import dialog
On linux SndFileSource::get_soundfile_info was being called with an empty path value when clicking on a folder in the left side part of the file browser which resulted in an unnecessary error message. On Windows every time a directory was selected in the Import dialog, SndFileSource::get_soundfile_info would fail to open the directory in read only mode and produce an error, but as we don't want to query/open soundfile info for directories anyway just test and return if the path is a directory.
This commit is contained in:
parent
b3b5646a30
commit
ad6c71e1fd
1 changed files with 4 additions and 0 deletions
|
|
@ -937,6 +937,10 @@ SndFileSource::get_soundfile_info (const string& path, SoundFileInfo& info, stri
|
|||
|
||||
sf_info.format = 0; // libsndfile says to clear this before sf_open().
|
||||
|
||||
if (path.empty() || Glib::file_test(path, Glib::FILE_TEST_IS_DIR)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
int fd = g_open (path.c_str(), O_RDONLY, 0444);
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue