summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-12-21 13:24:16 +0000
committerCarl Hetherington <cth@carlh.net>2015-12-21 13:24:16 +0000
commit0fc3ae397e281035627ad8848b4a50c093ae5e4f (patch)
tree823bc3605a8a953424980fdcba2fdd94244cfe7b
parentb0838292820cf1b3326529fa4d31862b3f9df9f3 (diff)
Increase number of frames stored in memory before write (#748).
-rw-r--r--ChangeLog2
-rw-r--r--src/lib/writer.cc11
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0cdf8131b..ec4c1c988 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2015-12-21 c.hetherington <cth@carlh.net>
+ * Reduce frequency of temporary writes to disk (#748).
+
* Use new Dolby website for both Doremi and Dolby certificates (#775).
2015-12-18 c.hetherington <cth@carlh.net>
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 93f5ed6d6..47c6b8381 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -570,7 +570,16 @@ operator== (QueueItem const & a, QueueItem const & b)
void
Writer::set_encoder_threads (int threads)
{
- _maximum_frames_in_memory = lrint (threads * 1.1);
+ /* I think the scaling factor here should be the ratio of the longest frame
+ encode time to the shortest; if the thread count is T, longest time is L
+ and the shortest time S we could encode L/S frames per thread whilst waiting
+ for the L frame to encode so we might have to store LT/S frames.
+
+ However we don't want to use too much memory, so keep it a bit lower than we'd
+ perhaps like. A J2K frame is typically about 1Mb so 3 here will mean we could
+ use about 240Mb with 72 encoding threads.
+ */
+ _maximum_frames_in_memory = lrint (threads * 3);
}
void