diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-05-20 11:12:55 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-05-23 16:55:28 +0200 |
| commit | ef051b519b678e0c8b59e2e1a13acdabccc36a67 (patch) | |
| tree | 82b3a681da436aa110402223caddd0e99bae0492 /src/lib/j2k_encoder.cc | |
| parent | 8e017c66d86c09a4689afeac0d7989d24daef745 (diff) | |
Move encode_{locally,remotely} into the frame encoder classes.
Diffstat (limited to 'src/lib/j2k_encoder.cc')
| -rw-r--r-- | src/lib/j2k_encoder.cc | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/lib/j2k_encoder.cc b/src/lib/j2k_encoder.cc index 47d8b1295..f9969927f 100644 --- a/src/lib/j2k_encoder.cc +++ b/src/lib/j2k_encoder.cc @@ -137,14 +137,11 @@ J2KEncoder::end () So just mop up anything left in the queue here. */ + CPUJ2KFrameEncoder cpu; for (auto const& i: _queue) { LOG_GENERAL(N_("Encode left-over frame %1"), i.index()); try { - _writer->write ( - make_shared<dcp::ArrayData>(i.encode_locally()), - i.index(), - i.eyes() - ); + _writer->write(make_shared<dcp::ArrayData>(*cpu.encode(i)), i.index(), i.eyes()); frame_done (); } catch (std::exception& e) { LOG_ERROR (N_("Local encode failed (%1)"), e.what ()); @@ -290,12 +287,6 @@ try return; } - /* Number of seconds that we currently wait between attempts - to connect to the server; not relevant for localhost - encodings. - */ - int remote_backoff = 0; - while (true) { LOG_TIMING ("encoder-sleep thread=%1", thread_id ()); @@ -332,10 +323,6 @@ try } } - if (remote_backoff > 0) { - boost::this_thread::sleep (boost::posix_time::seconds (remote_backoff)); - } - /* The queue might not be full any more, so notify anything that is waiting on that */ lock.lock (); _full_condition.notify_all (); |
