summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-10-16 15:08:48 +0100
committerCarl Hetherington <cth@carlh.net>2015-10-16 15:08:48 +0100
commitf09e6545efa4c5ca816e89e28a287bc6ab1ee50b (patch)
tree819424b88662a3c727e111ccfb1febb0778383a4 /src/lib
parentad7ed1d8be8ce4cf55cbcadb3a6576e8c95f9877 (diff)
Remove the dreaded _decoded_video size assertion.
I am reasonably convinced that the accumulation of _decoded_video is an optimisation rather than being required for correctness, so it's no problem to throw frames away as the code will just get them back again if and when it needs them.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/video_decoder.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc
index 4b9272413..efc0ecf11 100644
--- a/src/lib/video_decoder.cc
+++ b/src/lib/video_decoder.cc
@@ -318,10 +318,14 @@ VideoDecoder::video (shared_ptr<const ImageProxy> image, Frame frame)
copy (to_push.begin(), to_push.end(), back_inserter (_decoded_video));
- /* We can't let this build up too much or we will run out of memory. We need to allow
- the most frames that can exist between blocks of sound in a multiplexed file.
+ /* We can't let this build up too much or we will run out of memory. There is a
+ `best' value for the allowed size of _decoded_video which balances memory use
+ with decoding efficiency (lack of seeks). Throwing away video frames here
+ is not a problem for correctness, so do it.
*/
- DCPOMATIC_ASSERT (_decoded_video.size() <= 96);
+ while (_decoded_video.size() > 96) {
+ _decoded_video.pop_back ();
+ }
}
void