summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dcp.cc6
-rw-r--r--src/picture_asset.cc8
-rw-r--r--src/sound_asset.cc4
3 files changed, 12 insertions, 6 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index 65a6a826..d3c5367b 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -52,7 +52,7 @@ DCP::DCP (string directory, string name, ContentKind content_kind, int fps, int
, _fps (fps)
, _length (length)
{
-
+ filesystem::create_directories (directory);
}
void
@@ -274,8 +274,8 @@ DCP::DCP (string directory)
p = (*i)->asset_list->main_stereoscopic_picture;
}
- assert (_fps == 0 || _fps == p->frame_rate.numerator);
- _fps = p->frame_rate.numerator;
+ assert (_fps == 0 || _fps == p->edit_rate.numerator);
+ _fps = p->edit_rate.numerator;
_length += p->duration;
shared_ptr<PictureAsset> picture;
diff --git a/src/picture_asset.cc b/src/picture_asset.cc
index 3fbc0947..abc902d4 100644
--- a/src/picture_asset.cc
+++ b/src/picture_asset.cc
@@ -280,6 +280,8 @@ MonoPictureAsset::construct (sigc::slot<string, int> get_path)
for (int i = 0; i < _length; ++i) {
string const path = get_path (i);
+
+ cout << "reading " << path << "\n";
if (ASDCP_FAILURE (j2k_parser.OpenReadFrame (path.c_str(), frame_buffer))) {
throw FileError ("could not open JPEG2000 file for reading", path);
@@ -289,8 +291,10 @@ MonoPictureAsset::construct (sigc::slot<string, int> get_path)
if (ASDCP_FAILURE (mxf_writer.WriteFrame (frame_buffer, 0, 0))) {
throw MiscError ("error in writing video MXF");
}
-
- (*_progress) (0.5 * float (i) / _length);
+
+ if (_progress) {
+ (*_progress) (0.5 * float (i) / _length);
+ }
}
if (ASDCP_FAILURE (mxf_writer.Finalize())) {
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index 75ca3a76..732bb610 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -170,7 +170,9 @@ SoundAsset::construct (sigc::slot<string, Channel> get_path)
throw MiscError ("could not write audio MXF frame");
}
- (*_progress) (0.5 * float (i) / _length);
+ if (_progress) {
+ (*_progress) (0.5 * float (i) / _length);
+ }
}
if (ASDCP_FAILURE (mxf_writer.Finalize())) {