diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-22 00:49:15 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-22 00:49:15 +0100 |
| commit | 595d4fbfee788edfad7f9f8dfe7e76ee634c1a94 (patch) | |
| tree | a4a3f440c20cd1460eb823bcfb34d1503b39c4f7 /src/reel_picture_asset.cc | |
| parent | 81daf10958b05fc0d617d421617da33ab45f2f4c (diff) | |
Various attempts to clean up DCP comparison code.
Diffstat (limited to 'src/reel_picture_asset.cc')
| -rw-r--r-- | src/reel_picture_asset.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/reel_picture_asset.cc b/src/reel_picture_asset.cc index 4f737a91..1fbd635b 100644 --- a/src/reel_picture_asset.cc +++ b/src/reel_picture_asset.cc @@ -32,6 +32,7 @@ using std::bad_cast; using std::string; using std::stringstream; using boost::shared_ptr; +using boost::dynamic_pointer_cast; using namespace dcp; ReelPictureAsset::ReelPictureAsset () @@ -96,3 +97,28 @@ ReelPictureAsset::key_type () const { return "MDIK"; } + +bool +ReelPictureAsset::equals (shared_ptr<const ReelAsset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const +{ + if (!ReelAsset::equals (other, opt, note)) { + return false; + } + + shared_ptr<const ReelPictureAsset> rpa = dynamic_pointer_cast<const ReelPictureAsset> (other); + if (!rpa) { + return false; + } + + if (_frame_rate != rpa->_frame_rate) { + note (DCP_ERROR, "frame rates differ in reel"); + return false; + } + + if (_screen_aspect_ratio != rpa->_screen_aspect_ratio) { + note (DCP_ERROR, "screen aspect ratios differ in reel"); + return false; + } + + return true; +} |
