Check for J2K data before checking for similarity of frames; fixes #599.
authorCarl Hetherington <cth@carlh.net>
Thu, 11 Jun 2015 15:24:36 +0000 (16:24 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 11 Jun 2015 15:24:36 +0000 (16:24 +0100)
ChangeLog
src/lib/encoder.cc

index 531fb654cda72cb5cc99a4ac290ab7c69c65edb3..11b48165d348851e3fcb27b3f2a58e9cf04c0d03 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2015-06-11  c.hetherington  <cth@carlh.net>
 
+       * Fix massive slowdown of direct J2K->DCP encodes (#599).
+
        * Fix hang on audio analysis in some cases (#598).
 
        * Fix never-ending encode when XYZ values are clamped (#600).
index 6eb29541267982cc5999dc34d02da1eabb355186..d0764ac35d8fa89393a872b6c7c8c5aca3947885 100644 (file)
@@ -221,11 +221,11 @@ Encoder::enqueue (shared_ptr<PlayerVideo> pv)
                /* We can fake-write this frame */
                _writer->fake_write (_video_frames_enqueued, pv->eyes ());
                frame_done ();
-       } else if (_last_player_video && pv->same (_last_player_video)) {
-               _writer->repeat (_video_frames_enqueued, pv->eyes ());
        } else if (pv->has_j2k ()) {
                /* This frame already has JPEG2000 data, so just write it */
                _writer->write (pv->j2k(), _video_frames_enqueued, pv->eyes ());
+       } else if (_last_player_video && pv->same (_last_player_video)) {
+               _writer->repeat (_video_frames_enqueued, pv->eyes ());
        } else {
                /* Queue this new frame for encoding */
                LOG_TIMING ("adding to queue of %1", _queue.size ());