diff options
| author | jhurst <jhurst@cinecert.com> | 2021-04-13 15:50:50 -0700 |
|---|---|---|
| committer | jhurst <jhurst@cinecert.com> | 2021-04-13 15:50:50 -0700 |
| commit | b14d706a72c706c9c59dbdf64a9e41f32465e060 (patch) | |
| tree | 642c62a644544afb531a8fdbfd4e610bb72728ed /src/AS_DCP_ATMOS.cpp | |
| parent | 4e0891ab9ee94b822043126ea07e97641015e9b7 (diff) | |
o Added a Clone() method to InterchangeObject and derivatives
that allows making a descriptor copy that is not owned by
any other strucure. The caller must arrange to delete the
object pointer returned.
o While implementing the above it became obvious that the
reference-to-a-pointer-to-the-dictionary idiom that is used
throughout the lower levels of the MXF library was the
cause of much more grief than it was originally designed to
prevent. This was made even more obvious when I replaced all
of it with simple pointers, which revealed several shadow
instances of m_Dict that were only reliable while the object
that held them was valid.
Diffstat (limited to 'src/AS_DCP_ATMOS.cpp')
| -rw-r--r-- | src/AS_DCP_ATMOS.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/AS_DCP_ATMOS.cpp b/src/AS_DCP_ATMOS.cpp index cdba985..d476e20 100644 --- a/src/AS_DCP_ATMOS.cpp +++ b/src/AS_DCP_ATMOS.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2004-2016, John Hurst +Copyright (c) 2004-2021, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -117,7 +117,7 @@ class ASDCP::ATMOS::MXFReader::h__Reader : public ASDCP::h__ASDCPReader ASDCP::DCData::DCDataDescriptor m_DDesc; AtmosDescriptor m_ADesc; - h__Reader(const Dictionary& d) : + h__Reader(const Dictionary *d) : ASDCP::h__ASDCPReader(d), m_EssenceDescriptor(0), m_EssenceSubDescriptor(0) {} virtual ~h__Reader() {} Result_t OpenRead(const std::string&); @@ -251,7 +251,7 @@ ASDCP::ATMOS::MXFReader::h__Reader::ReadFrame(ui32_t FrameNum, FrameBuffer& Fram ASDCP::ATMOS::MXFReader::MXFReader() { - m_Reader = new h__Reader(AtmosSMPTEDict()); + m_Reader = new h__Reader(&AtmosSMPTEDict()); } @@ -406,7 +406,7 @@ class ASDCP::ATMOS::MXFWriter::h__Writer : public ASDCP::h__ASDCPWriter public: AtmosDescriptor m_ADesc; - h__Writer(const Dictionary& d) : ASDCP::h__ASDCPWriter(d), + h__Writer(const Dictionary *d) : ASDCP::h__ASDCPWriter(d), m_EssenceSubDescriptor(0), m_ADesc() { memset(m_EssenceUL, 0, SMPTE_UL_LENGTH); } @@ -650,7 +650,7 @@ ASDCP::ATMOS::MXFWriter::OpenWrite(const std::string& filename, const WriterInfo return RESULT_FORMAT; } - m_Writer = new h__Writer(AtmosSMPTEDict()); + m_Writer = new h__Writer(&AtmosSMPTEDict()); m_Writer->m_Info = Info; Result_t result = m_Writer->OpenWrite(filename, HeaderSize, ADesc); |
