summaryrefslogtreecommitdiff
path: root/src/lib/j2k_encoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-09-26 13:29:59 +0200
committerCarl Hetherington <cth@carlh.net>2023-10-16 17:57:18 +0200
commit6b13ea7afe677cc4f727371d507c49be3af984db (patch)
treea4ae4873f38235180c38841fff7792254edf92b3 /src/lib/j2k_encoder.cc
parent9df4e636e2e35be7b17d1a507d6906d257bf83a2 (diff)
Create a single DcpomaticContext for all GrokContexts, rather than copying them.
I think this makes sense, and also allows us to forward-declare the contexts in a forthcoming commit.
Diffstat (limited to 'src/lib/j2k_encoder.cc')
-rw-r--r--src/lib/j2k_encoder.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/j2k_encoder.cc b/src/lib/j2k_encoder.cc
index 22f2ea6d7..fe63deacd 100644
--- a/src/lib/j2k_encoder.cc
+++ b/src/lib/j2k_encoder.cc
@@ -68,7 +68,7 @@ J2KEncoder::J2KEncoder(shared_ptr<const Film> film, Writer& writer)
, _history (200)
, _writer (writer)
#ifdef DCPOMATIC_GROK
- , _dcpomatic_context(film, writer, _history, Config::instance()->gpu_binary_location())
+ , _dcpomatic_context(new grk_plugin::DcpomaticContext(film, writer, _history, Config::instance()->gpu_binary_location()))
, _context(Config::instance()->enable_gpu() ? new grk_plugin::GrokContext(_dcpomatic_context) : nullptr)
#endif
{
@@ -84,6 +84,7 @@ J2KEncoder::~J2KEncoder ()
#ifdef DCPOMATIC_GROK
delete _context;
+ delete _dcpomatic_context;
#endif
}