summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-10-20 21:16:49 +0200
committerCarl Hetherington <cth@carlh.net>2025-10-20 21:16:49 +0200
commita8d449a0a35f205833b446aeae66564aa2464736 (patch)
treebbc4b45b3e216c75d88131761215fdcd03d4a256
parent219776f17374c273d4da176c262e8c7ec7b1329b (diff)
Remove ASDCPErrorSuspender.v1.10.34
I think it's not possible to do this thread-safely without quite noisy changes to asdcplib: DefaultLogSink() refers a reference which can be deleted by ASDCPErrorSuspender before it is used. DefaultLogSink() could return a shared_ptr but there's a lot of callsites.
-rw-r--r--src/smpte_text_asset.cc6
-rw-r--r--src/util.cc15
-rw-r--r--src/util.h13
-rw-r--r--test/sound_frame_test.cc5
-rw-r--r--test/verify_test.cc1
5 files changed, 2 insertions, 38 deletions
diff --git a/src/smpte_text_asset.cc b/src/smpte_text_asset.cc
index 02ea9a16..63e8c8ab 100644
--- a/src/smpte_text_asset.cc
+++ b/src/smpte_text_asset.cc
@@ -98,11 +98,7 @@ SMPTETextAsset::SMPTETextAsset(boost::filesystem::path file)
Kumu::FileReaderFactory factory;
auto reader = make_shared<ASDCP::TimedText::MXFReader>(factory);
- auto r = Kumu::RESULT_OK;
- {
- ASDCPErrorSuspender sus;
- r = reader->OpenRead(dcp::filesystem::fix_long_path(*_file).string().c_str());
- }
+ auto const r = reader->OpenRead(dcp::filesystem::fix_long_path(*_file).string().c_str());
if (!ASDCP_FAILURE(r)) {
/* MXF-wrapped */
ASDCP::WriterInfo info;
diff --git a/src/util.cc b/src/util.cc
index 8ad90dbf..77493ffa 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -410,21 +410,6 @@ dcp::unique_string (vector<string> existing, string base)
}
-ASDCPErrorSuspender::ASDCPErrorSuspender ()
- : _old (Kumu::DefaultLogSink())
-{
- _sink = new Kumu::EntryListLogSink(_log);
- Kumu::SetDefaultLogSink (_sink);
-}
-
-
-ASDCPErrorSuspender::~ASDCPErrorSuspender ()
-{
- Kumu::SetDefaultLogSink (&_old);
- delete _sink;
-}
-
-
boost::filesystem::path dcp::directory_containing_executable ()
{
#if BOOST_VERSION >= 106100
diff --git a/src/util.h b/src/util.h
index 52cb135d..cfed9fcb 100644
--- a/src/util.h
+++ b/src/util.h
@@ -153,19 +153,6 @@ extern boost::filesystem::path directory_containing_executable ();
extern boost::filesystem::path resources_directory ();
-class ASDCPErrorSuspender
-{
-public:
- ASDCPErrorSuspender();
- ~ASDCPErrorSuspender();
-
-private:
- Kumu::LogEntryList _log;
- Kumu::ILogSink& _old;
- Kumu::EntryListLogSink* _sink;
-};
-
-
template <class From, class To>
void
add_to_container(To& container, From source)
diff --git a/test/sound_frame_test.cc b/test/sound_frame_test.cc
index a8060bd4..e406cb38 100644
--- a/test/sound_frame_test.cc
+++ b/test/sound_frame_test.cc
@@ -87,10 +87,7 @@ BOOST_AUTO_TEST_CASE (sound_frame_test)
BOOST_AUTO_TEST_CASE (sound_frame_test2)
{
- {
- dcp::ASDCPErrorSuspender sus;
- BOOST_CHECK_THROW (dcp::SoundAsset("frobozz"), dcp::FileError);
- }
+ BOOST_CHECK_THROW(dcp::SoundAsset("frobozz"), dcp::FileError);
dcp::SoundAsset asset (
private_test /
diff --git a/test/verify_test.cc b/test/verify_test.cc
index 8395aaa1..2cc08b10 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -519,7 +519,6 @@ BOOST_AUTO_TEST_CASE (verify_incorrect_picture_sound_hash)
BOOST_REQUIRE (fwrite (&x, sizeof(x), 1, mod) == 1);
fclose (mod);
- dcp::ASDCPErrorSuspender sus;
check_verify_result (
{ dir },
{},