From 5e6d5830bc03e073c2a064cd2e715637f0a05dfc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 12 Sep 2017 21:56:10 +0100 Subject: Fix repeated subtitles when reading SMPTE encrypted DCPs. --- src/smpte_subtitle_asset.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc index c2456b9c..e52cd2ef 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_subtitle_asset.cc @@ -198,11 +198,17 @@ SMPTESubtitleAsset::read_mxf_descriptor (shared_ptr void SMPTESubtitleAsset::set_key (Key key) { + /* See if we already have a key; if we do, and we have a file, we'll already + have read that file. + */ + bool const had_key = static_cast (_key); + MXF::set_key (key); - if (!_key_id || !_file) { - /* Either we don't have any data to read, or it wasn't - encrypted, so we don't need to do anything else. + if (!_key_id || !_file || had_key) { + /* Either we don't have any data to read, it wasn't + encrypted, or we've already read it, so we don't + need to do anything else. */ return; } -- cgit v1.2.3