From deadc1bf01e8bc68905c7d33578ffb77b8317c8f Mon Sep 17 00:00:00 2001 From: msheby Date: Thu, 25 Oct 2007 18:44:45 +0000 Subject: Win32 portability fixes --- src/h__Reader.cpp | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) (limited to 'src/h__Reader.cpp') diff --git a/src/h__Reader.cpp b/src/h__Reader.cpp index 7bc8955..8035ac8 100755 --- a/src/h__Reader.cpp +++ b/src/h__Reader.cpp @@ -150,35 +150,24 @@ ASDCP::h__Reader::InitMXFIndex() } // -class KLReader : public ASDCP::KLVPacket +Result_t +ASDCP::KLReader::ReadKLFromFile(Kumu::FileReader& Reader) { - ASDCP_NO_COPY_CONSTRUCT(KLReader); - byte_t m_KeyBuf[32]; - -public: - KLReader() {} - ~KLReader() {} - - inline const byte_t* Key() { return m_KeyBuf; } - inline const ui64_t Length() { return m_ValueLength; } - inline const ui64_t KLLength() { return m_KLLength; } + ui32_t read_count; + ui32_t header_length = SMPTE_UL_LENGTH + MXF_BER_LENGTH; + Result_t result = Reader.Read(m_KeyBuf, header_length, &read_count); - Result_t ReadKLFromFile(Kumu::FileReader& Reader) - { - ui32_t read_count; - ui32_t header_length = SMPTE_UL_LENGTH + MXF_BER_LENGTH; - Result_t result = Reader.Read(m_KeyBuf, header_length, &read_count); - - if ( read_count != header_length ) - return RESULT_READFAIL; + if ( ASDCP_SUCCESS(result) ) + { + if ( read_count != header_length ) + result = RESULT_READFAIL; - if ( ASDCP_SUCCESS(result) ) - result = InitFromBuffer(m_KeyBuf, header_length); - - return result; - } -}; + else + result = InitFromBuffer(m_KeyBuf, header_length); + } + return result; +} // standard method of reading a plaintext or encrypted frame Result_t -- cgit v1.2.3