diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-01 23:53:06 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-01 23:53:06 +0100 |
| commit | a68b877d96a9e9f366f27752e071bc0e895e9dc7 (patch) | |
| tree | 11a32d1efd6abf182b03ce22f1f1fe84258bb7de /src/sound_frame.cc | |
| parent | f9cba324c8160a70b108d9e5b60a4ccad6ee9be2 (diff) | |
Add Reader classes to permit much more efficient DCP reading.
Diffstat (limited to 'src/sound_frame.cc')
| -rw-r--r-- | src/sound_frame.cc | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/sound_frame.cc b/src/sound_frame.cc index 2d31291b..540c3dfd 100644 --- a/src/sound_frame.cc +++ b/src/sound_frame.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -30,18 +30,12 @@ using namespace std; using namespace dcp; -SoundFrame::SoundFrame (boost::filesystem::path path, int n, ASDCP::AESDecContext* c) +SoundFrame::SoundFrame (ASDCP::PCM::MXFReader* reader, int n, ASDCP::AESDecContext* c) { - ASDCP::PCM::MXFReader reader; - Kumu::Result_t r = reader.OpenRead (path.string().c_str()); - if (ASDCP_FAILURE (r)) { - boost::throw_exception (FileError ("could not open MXF file for reading", path, r)); - } - /* XXX: unfortunate guesswork on this buffer size */ _buffer = new ASDCP::PCM::FrameBuffer (1 * Kumu::Megabyte); - if (ASDCP_FAILURE (reader.ReadFrame (n, *_buffer, c))) { + if (ASDCP_FAILURE (reader->ReadFrame (n, *_buffer, c))) { boost::throw_exception (DCPReadError ("could not read audio frame")); } } |
