diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-03-18 00:29:47 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-03-18 00:29:47 +0000 |
| commit | 099cb53c7a1079b3d3b2bf0c1cf635673a0192fd (patch) | |
| tree | e56297d012812c24d63f512b71367420b228ee17 /tools | |
| parent | e5ce888e953340ca94d506d710f90fec93540cd2 (diff) | |
Accept that <Duration> and <EntryPoint> are optional, and account for this in tests.
Also fix tests to reflect <AnnotationText> no longer being filled in with a default
value.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/dcpinfo.cc | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/tools/dcpinfo.cc b/tools/dcpinfo.cc index d0edbd3b..d06d2068 100644 --- a/tools/dcpinfo.cc +++ b/tools/dcpinfo.cc @@ -95,11 +95,17 @@ main_picture (shared_ptr<Reel> reel, bool analyse, bool decompress) return; } - cout << " Picture ID: " << reel->main_picture()->id() - << " entry " << reel->main_picture()->entry_point() - << " duration " << reel->main_picture()->duration() - << " (" << dcp::Time(reel->main_picture()->duration(), reel->main_picture()->frame_rate().as_float(), reel->main_picture()->frame_rate().as_float()).as_string(dcp::SMPTE) << ")" - << " intrinsic " << reel->main_picture()->intrinsic_duration(); + cout << " Picture ID: " << reel->main_picture()->id(); + if (reel->main_picture()->entry_point()) { + cout << " entry " << *reel->main_picture()->entry_point(); + } + if (reel->main_picture()->duration()) { + cout << " duration " << *reel->main_picture()->duration() + << " (" << dcp::Time(*reel->main_picture()->duration(), reel->main_picture()->frame_rate().as_float(), reel->main_picture()->frame_rate().as_float()).as_string(dcp::SMPTE) << ")" + << " intrinsic " << reel->main_picture()->intrinsic_duration(); + } else { + cout << " intrinsic duration " << reel->main_picture()->intrinsic_duration(); + } if (reel->main_picture()->asset_ref().resolved()) { if (reel->main_picture()->asset()) { @@ -146,10 +152,17 @@ static void main_sound (shared_ptr<Reel> reel) { if (reel->main_sound()) { - cout << " Sound ID: " << reel->main_sound()->id() - << " entry " << reel->main_picture()->entry_point() - << " duration " << reel->main_picture()->duration() - << " intrinsic " << reel->main_picture()->intrinsic_duration(); + cout << " Sound ID: " << reel->main_sound()->id(); + if (reel->main_sound()->entry_point()) { + cout << " entry " << *reel->main_sound()->entry_point(); + } + if (reel->main_sound()->duration()) { + cout << " duration " << *reel->main_sound()->duration() + << " intrinsic " << reel->main_sound()->intrinsic_duration(); + } else { + cout << " intrinsic duration " << reel->main_sound()->intrinsic_duration(); + } + if (reel->main_sound()->asset_ref().resolved()) { if (reel->main_sound()->asset()) { cout << "\n Sound: " |
