diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-08-22 18:57:05 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-08-22 18:57:05 +0100 |
| commit | 0251d3f2986bf70d4721b7127ca6ddcc9da3b256 (patch) | |
| tree | 5b8bee96ae9bd53c7e78c264cdf08993f3a28e41 /src | |
| parent | 422c8a63d2368a2e63aee4c391207e3332d1d4c7 (diff) | |
Add basic example; tweak bits and pieces.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dcp.cc | 6 | ||||
| -rw-r--r-- | src/picture_asset.cc | 8 | ||||
| -rw-r--r-- | src/sound_asset.cc | 4 |
3 files changed, 12 insertions, 6 deletions
@@ -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())) { |
