Merge branch 'master' into cairocanvas
[ardour.git] / libs / ardour / audiofilesource.cc
index 2486d45ca1c21cd13983af534a4ea540fb2a9e2d..014baa90317b13c420af7c9863378ef6ddd4f976 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <sndfile.h>
 
+#include <glib/gstdio.h>
 #include <glibmm/miscutils.h>
 #include <glibmm/fileutils.h>
 #include <glibmm/threads.h>
@@ -95,8 +96,6 @@ AudioFileSource::AudioFileSource (Session& s, const string& path, Source::Flag f
           /* note that external files have their own path as "origin" */
        , FileSource (s, DataType::AUDIO, path, path, flags)
 {
-        /* note that origin remains empty */
-
        if (init (_path, true)) {
                throw failed_constructor ();
        }
@@ -135,8 +134,8 @@ AudioFileSource::~AudioFileSource ()
 {
        DEBUG_TRACE (DEBUG::Destruction, string_compose ("AudioFileSource destructor %1, removable? %2\n", _path, removable()));
        if (removable()) {
-               unlink (_path.c_str());
-               unlink (peakpath.c_str());
+               ::g_unlink (_path.c_str());
+               ::g_unlink (peakpath.c_str());
        }
 }
 
@@ -294,7 +293,7 @@ AudioFileSource::mark_streaming_write_completed ()
 int
 AudioFileSource::move_dependents_to_trash()
 {
-       return ::unlink (peakpath.c_str());
+       return ::g_unlink (peakpath.c_str());
 }
 
 void
@@ -322,7 +321,7 @@ int
 AudioFileSource::setup_peakfile ()
 {
        if (!(_flags & NoPeakFile)) {
-               return initialize_peakfile (_file_is_new, _path);
+               return initialize_peakfile (_path);
        } else {
                return 0;
        }