diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-09-12 21:56:10 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-09-12 21:56:10 +0100 |
| commit | 5e6d5830bc03e073c2a064cd2e715637f0a05dfc (patch) | |
| tree | 7eada7cb4988f024a1da15ca8fd8825debbeb637 /src | |
| parent | f7a7c55a113e3237a747481b47e07e8bbe2c4eb1 (diff) | |
Fix repeated subtitles when reading SMPTE encrypted DCPs.
Diffstat (limited to 'src')
| -rw-r--r-- | src/smpte_subtitle_asset.cc | 12 |
1 files changed, 9 insertions, 3 deletions
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<ASDCP::TimedText::MXFReader> 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<bool> (_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; } |
