boost::optional<SourceFrame>
Film::dcp_length () const
{
+ if (content_type() == STILL) {
+ return _still_duration * frames_per_second();
+ }
+
if (!length()) {
return boost::optional<SourceFrame> ();
}
set_size (d.video->native_size ());
set_frames_per_second (d.video->frames_per_second ());
set_subtitle_streams (d.video->subtitle_streams ());
- set_content_audio_streams (d.audio->audio_streams ());
+ if (d.audio) {
+ set_content_audio_streams (d.audio->audio_streams ());
+ }
/* Start off with the first audio and subtitle streams */
- if (!d.audio->audio_streams().empty()) {
+ if (d.audio && !d.audio->audio_streams().empty()) {
set_content_audio_stream (d.audio->audio_streams().front());
}
signal_changed (CONTENT);
- set_content_digest (md5_digest (content_path ()));
-
examine_content ();
} catch (...) {
throw;
}
+
+ /* Default format */
+ switch (content_type()) {
+ case STILL:
+ set_format (Format::from_id ("var-185"));
+ break;
+ case VIDEO:
+ set_format (Format::from_id ("185"));
+ break;
+ }
+
+ /* Still image DCPs must use external audio */
+ if (content_type() == STILL) {
+ set_use_content_audio (false);
+ }
}
void