diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-13 14:38:12 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-13 14:38:12 +0100 |
| commit | 13aae5d8ff27886656ab7ea3ef1194987954bb3f (patch) | |
| tree | 315d023a86f16fa8c0ae2e2c87fbc20071316fe8 /src/lib/decoder_factory.cc | |
| parent | 1daaa67c21d4d28757cdcb06c5e26aec3817867c (diff) | |
Remove caching of old ImageDecoder objects.
This breaks things when there is a 3D ImageContent. When
you change the video frame type on this content the view
does not update because the re-used ImageDecoder recycles
the same video without noticing that the frame type has changed.
I guess this is sort of `because' the video frame type is used
in VideoDecoder::give, which sets up the cache.
Unfortunately I can't remember the case which the caching
of ImageDecoders was meant to speed up. Maybe this will
now become apparent.
Diffstat (limited to 'src/lib/decoder_factory.cc')
| -rw-r--r-- | src/lib/decoder_factory.cc | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/lib/decoder_factory.cc b/src/lib/decoder_factory.cc index 7f53c9a4b..dc01a043a 100644 --- a/src/lib/decoder_factory.cc +++ b/src/lib/decoder_factory.cc @@ -37,7 +37,7 @@ using boost::shared_ptr; using boost::dynamic_pointer_cast; shared_ptr<Decoder> -decoder_factory (shared_ptr<const Content> content, list<shared_ptr<ImageDecoder> > old_image_decoders, shared_ptr<Log> log, bool fast) +decoder_factory (shared_ptr<const Content> content, shared_ptr<Log> log, bool fast) { shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<const FFmpegContent> (content); if (fc) { @@ -51,20 +51,7 @@ decoder_factory (shared_ptr<const Content> content, list<shared_ptr<ImageDecoder shared_ptr<const ImageContent> ic = dynamic_pointer_cast<const ImageContent> (content); if (ic) { - shared_ptr<Decoder> decoder; - - /* See if we can re-use an old ImageDecoder */ - BOOST_FOREACH (shared_ptr<ImageDecoder> i, old_image_decoders) { - if (i->content() == ic) { - decoder = i; - } - } - - if (!decoder) { - decoder.reset (new ImageDecoder (ic, log)); - } - - return decoder; + return shared_ptr<Decoder> (new ImageDecoder (ic, log)); } shared_ptr<const TextSubtitleContent> rc = dynamic_pointer_cast<const TextSubtitleContent> (content); |
