use pbd's gstdio compatibility wrapper
[ardour.git] / libs / ardour / export_handler.cc
index 46cd247d20496d8fd8cef872ba180ea720c3035d..0def821ef623b5bb874268a74c40098cf96b9940 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "ardour/export_handler.h"
 
-#include <glib/gstdio.h>
+#include <pbd/gstdio_compat.h>
 #include <glibmm.h>
 #include <glibmm/convert.h>
 
@@ -310,6 +310,13 @@ ExportHandler::finish_timespan ()
                }
 
                if (fmt->tag()) {
+                       /* close file first, otherwise TagLib enounters an ERROR_SHARING_VIOLATION
+                        * The process cannot access the file because it is being used.
+                        *
+                        * TODO: check Umlauts and encoding in filename.
+                        * TagLib eventually calls CreateFileA(),
+                        */
+                       graph_builder->reset ();
                        AudiofileTagger::tag_file(filename, *SessionMetadata::Metadata());
                }