diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-03-20 00:31:22 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-03-22 13:29:58 +0100 |
| commit | e32e6654b983bf4928b6f27a627b1e6305188cf6 (patch) | |
| tree | 28da2444bfe057fce97522df3eb7fa136eebf901 /src/lib/j2k_sync_encoder_thread.h | |
| parent | 650f919fdda3632262ddbf98d1a37a5e98eaedda (diff) | |
Move remote backoff sleep to before we pop a frame from the queue.
Otherwise in the case of failure it can take a while for the frame to
become available again for a functioning thread to encode.
Diffstat (limited to 'src/lib/j2k_sync_encoder_thread.h')
| -rw-r--r-- | src/lib/j2k_sync_encoder_thread.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/j2k_sync_encoder_thread.h b/src/lib/j2k_sync_encoder_thread.h index 45222279e..06bb1fcef 100644 --- a/src/lib/j2k_sync_encoder_thread.h +++ b/src/lib/j2k_sync_encoder_thread.h @@ -26,6 +26,11 @@ public: virtual void log_thread_start() const = 0; virtual std::shared_ptr<dcp::ArrayData> encode(DCPVideo const& frame) = 0; + /** @return number of seconds we should wait between attempts to use this thread + * for encoding. Used to avoid flooding non-responsive network servers with + * requests. + */ + virtual int backoff() const { return 0; } }; |
