Fix console noise when importing non-DCP MXFs (#1362).
authorCarl Hetherington <cth@carlh.net>
Fri, 7 Sep 2018 12:04:50 +0000 (13:04 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 7 Sep 2018 12:04:50 +0000 (13:04 +0100)
src/lib/atmos_mxf_content.cc
src/lib/video_mxf_content.cc

index 2fd9ead068cf3f9130afcd0d9efe9ec486277e19..a42b1095429fd35a467685185fce2f8f50be5905 100644 (file)
@@ -22,6 +22,7 @@
 #include "job.h"
 #include "film.h"
 #include "compose.hpp"
+#include <asdcp/KM_log.h>
 #include <dcp/atmos_asset.h>
 #include <dcp/exceptions.h>
 #include <libxml++/libxml++.h>
@@ -47,6 +48,8 @@ AtmosMXFContent::AtmosMXFContent (shared_ptr<const Film> film, cxml::ConstNodePt
 bool
 AtmosMXFContent::valid_mxf (boost::filesystem::path path)
 {
+       Kumu::DefaultLogSink().UnsetFilterFlag(Kumu::LOG_ALLOW_ALL);
+
        try {
                shared_ptr<dcp::AtmosAsset> a (new dcp::AtmosAsset (path));
                return true;
@@ -56,6 +59,8 @@ AtmosMXFContent::valid_mxf (boost::filesystem::path path)
 
        }
 
+       Kumu::DefaultLogSink().SetFilterFlag(Kumu::LOG_ALLOW_ALL);
+
        return false;
 }
 
index 325ea8e7214a460cc52e447c26e96e07cf5f4a56..8e762ae14f6d8545993f185d370a630dae1436eb 100644 (file)
@@ -24,6 +24,7 @@
 #include "job.h"
 #include "film.h"
 #include "compose.hpp"
+#include <asdcp/KM_log.h>
 #include <dcp/mono_picture_asset.h>
 #include <dcp/stereo_picture_asset.h>
 #include <dcp/exceptions.h>
@@ -50,6 +51,8 @@ VideoMXFContent::VideoMXFContent (shared_ptr<const Film> film, cxml::ConstNodePt
 bool
 VideoMXFContent::valid_mxf (boost::filesystem::path path)
 {
+       Kumu::DefaultLogSink().UnsetFilterFlag(Kumu::LOG_ALLOW_ALL);
+
        try {
                shared_ptr<dcp::MonoPictureAsset> mp (new dcp::MonoPictureAsset (path));
                return true;
@@ -60,6 +63,7 @@ VideoMXFContent::valid_mxf (boost::filesystem::path path)
        }
 
        try {
+               Kumu::DefaultLogSink().SetFilterFlag(0);
                shared_ptr<dcp::StereoPictureAsset> sp (new dcp::StereoPictureAsset (path));
                return true;
        } catch (dcp::MXFFileError& e) {
@@ -68,6 +72,8 @@ VideoMXFContent::valid_mxf (boost::filesystem::path path)
 
        }
 
+       Kumu::DefaultLogSink().SetFilterFlag(Kumu::LOG_ALLOW_ALL);
+
        return false;
 }