Add some new Waker calls.
authorCarl Hetherington <cth@carlh.net>
Mon, 4 Nov 2019 19:44:13 +0000 (20:44 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 4 Nov 2019 19:44:13 +0000 (20:44 +0100)
src/lib/encode_server.cc
src/lib/ffmpeg_encoder.cc

index 16c65db..314f8f6 100644 (file)
@@ -326,6 +326,9 @@ EncodeServer::handle (shared_ptr<Socket> socket)
 {
        boost::mutex::scoped_lock lock (_mutex);
 
+       Waker waker;
+       waker.nudge ();
+
        /* Wait until the queue has gone down a bit */
        while (_queue.size() >= _worker_threads.size() * 2 && !_terminate) {
                _full_condition.wait (lock);
index 4990858..6c00616 100644 (file)
@@ -130,6 +130,8 @@ FFmpegEncoder::go ()
                job->sub (_("Encoding"));
        }
 
+       Waker waker;
+
        list<DCPTimePeriod> reel_periods = _film->reels ();
        list<DCPTimePeriod>::const_iterator reel = reel_periods.begin ();
        list<FileEncoderSet>::iterator encoder = _file_encoders.begin ();
@@ -166,6 +168,8 @@ FFmpegEncoder::go ()
                        job->set_progress (float(i.get()) / _film->length().get());
                }
 
+               waker.nudge ();
+
                _butler->get_audio (interleaved, audio_frames);
                /* XXX: inefficient; butler interleaves and we deinterleave again */
                float* p = interleaved;