diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-12-16 01:58:57 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-12-26 17:20:25 +0100 |
| commit | 24728b74693bb84d79474e014cdb952abc8a79f2 (patch) | |
| tree | b18a95441b7fcf53232958b364c84bcee67f1695 /src/lib/film.cc | |
| parent | d7f6ab91208cb4a562ccd668ca2cc8135f124053 (diff) | |
Give ownership of info files to ReelWriters (#2912).v2.18.2
The motivation here is to stop a pattern where we create a file, close
it, and then re-open it (many times) as I think there are problems on
Windows when a virus scanner sees the new file, opens it for checking,
and then we can't re-open it.
This also makes things a fair bit simpler, as a lock is removed and we
don't try to differentiate read/write cases by opening the file in
different ways; it's now always writeable.
Diffstat (limited to 'src/lib/film.cc')
| -rw-r--r-- | src/lib/film.cc | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 1258cdb11..1ac519011 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -2235,21 +2235,6 @@ Film::marker (dcp::Marker type) const return i->second; } -shared_ptr<InfoFileHandle> -Film::info_file_handle (DCPTimePeriod period, bool read) const -{ - return std::make_shared<InfoFileHandle>(_info_file_mutex, info_file(period), read); -} - -InfoFileHandle::InfoFileHandle (boost::mutex& mutex, boost::filesystem::path path, bool read) - : _lock (mutex) - , _file(path, read ? "rb" : (dcp::filesystem::exists(path) ? "r+b" : "wb")) -{ - if (!_file) { - throw OpenFileError(path, _file.open_error(), read ? OpenFileError::READ : (dcp::filesystem::exists(path) ? OpenFileError::READ_WRITE : OpenFileError::WRITE)); - } -} - /** Add FFOC and LFOC markers to a list if they are not already there */ void |
