diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-04-13 23:36:22 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-04-13 23:36:22 +0200 |
| commit | 488e3d1bd5e6b17d49f6db4df14c64f4b64db89b (patch) | |
| tree | 641fcf167b845df6eca68c54fdf1110a7a07a739 /src/reel.cc | |
| parent | 51ae14c7e304d4fbc8d7524d584f3f4762d51f67 (diff) | |
Remove ReelEncryptableAsset and tidy up a bit.
Diffstat (limited to 'src/reel.cc')
| -rw-r--r-- | src/reel.cc | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/src/reel.cc b/src/reel.cc index 4baa2fc9..e99f7140 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -274,24 +274,15 @@ Reel::any_encrypted () const { auto ecc = false; for (auto i: _closed_captions) { - if (auto enc = dynamic_pointer_cast<ReelEncryptableAsset>(i)) { - if (enc->encrypted()) { - ecc = true; - } - } - } - - bool esub = false; - if (_main_subtitle) { - if (auto enc = dynamic_pointer_cast<ReelEncryptableAsset>(_main_picture)) { - esub = enc->encrypted(); + if (i->encrypted()) { + ecc = true; } } return ( (_main_picture && _main_picture->encrypted()) || (_main_sound && _main_sound->encrypted()) || - esub || + (_main_subtitle && _main_subtitle->encrypted()) || ecc || (_atmos && _atmos->encrypted()) ); @@ -303,25 +294,15 @@ Reel::all_encrypted () const { auto ecc = true; for (auto i: _closed_captions) { - if (auto enc = dynamic_pointer_cast<ReelEncryptableAsset>(i)) { - if (!enc->encrypted()) { - ecc = false; - } - } - } - - /* It's ok if there's no subtitle, or it's not encryptable */ - bool esub = true; - if (_main_subtitle) { - if (auto enc = dynamic_pointer_cast<ReelEncryptableAsset>(_main_picture)) { - esub = enc->encrypted(); + if (!i->encrypted()) { + ecc = false; } } return ( (!_main_picture || _main_picture->encrypted()) && (!_main_sound || _main_sound->encrypted()) && - esub && + (!_main_subtitle || _main_subtitle->encrypted()) && ecc && (!_atmos || _atmos->encrypted()) ); |
