diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-26 13:05:21 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-26 13:05:21 +0100 |
| commit | f40583c385c17dfc6ed13eff3ded5637cbf57089 (patch) | |
| tree | 60d1afa88ff44a30101ca8c2c0d3716914ce7806 /src/lib | |
| parent | 8a28f2a3ddf8cdc4e7e27b875cd7f5178b9dc555 (diff) | |
Try to fix name problems if an encode crosses midnight.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/film.cc | 12 | ||||
| -rw-r--r-- | src/lib/film.h | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 75dbfee3d..81de2b518 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -128,6 +128,7 @@ Film::Film (string d, bool must_exist) read_metadata (); _log = new FileLog (file ("log")); + set_dci_date_today (); } Film::Film (Film const & o) @@ -221,6 +222,8 @@ Film::j2k_dir () const void Film::make_dcp (bool transcode) { + set_dci_date_today (); + if (dcp_name().find ("/") != string::npos) { throw BadSettingError ("name", "cannot contain slashes"); } @@ -806,8 +809,7 @@ Film::dci_name () const d << _studio << "_"; } - boost::gregorian::date today = boost::gregorian::day_clock::local_day (); - d << boost::gregorian::to_iso_string (today) << "_"; + d << boost::gregorian::to_iso_string (_dci_date) << "_"; if (!_facility.empty ()) { d << _facility << "_"; @@ -1355,3 +1357,9 @@ Film::audio_channels () const return _audio_streams[_audio_stream].channels (); } + +void +Film::set_dci_date_today () +{ + _dci_date = boost::gregorian::day_clock::local_day (); +} diff --git a/src/lib/film.h b/src/lib/film.h index b2daf0f22..f3ddc652a 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -106,6 +106,8 @@ public: int audio_channels () const; + void set_dci_date_today (); + enum Property { NONE, NAME, @@ -390,6 +392,8 @@ private: /** Any running ExamineContentJob, or 0 */ boost::shared_ptr<ExamineContentJob> _examine_content_job; + boost::gregorian::date _dci_date; + std::string thumb_file_for_frame (int) const; std::string thumb_base_for_frame (int) const; void signal_changed (Property); |
