-//------------------------------------------------------------------------------------------
-//
-
-
-//
-ASDCP::Result_t
-ASDCP::KLVReader::ReadKLFromFile(ASDCP::FileReader& Reader)
-{
- ui32_t read_count;
- m_HeaderLength = klv_key_size + klv_length_size;
- Result_t result = Reader.Read(m_Key, m_HeaderLength, &read_count);
- assert(read_count == m_HeaderLength);
-
- if ( ASDCP_SUCCESS(result) )
- {
- m_BERLength = BER_length(m_Key + klv_key_size);
-
- if ( m_BERLength == 0 )
- {
- char intbuf[IntBufferLen];
- ASDCP::DefaultLogSink().Error("KLV format error, zero BER length not allowed at file position %s\n",
- i64szx((Reader.Tell() - (fpos_t)klv_key_size), 8, intbuf));
- return RESULT_FAIL;
- }
-
- if ( m_BERLength != klv_length_size )
- {
-
- ASDCP::DefaultLogSink().Error("Found packet with BER length %lu; being less efficient...\n",
- m_BERLength);
- // TODO: recover the correct BER value
- // and reposition the file pointer
- ASDCP::DefaultLogSink().Error("please finish me\n");
- assert(0);
- }
-
- if ( ! read_BER(m_Key + klv_key_size, &m_Length) )
- return RESULT_FAIL;
- }
-
- return result;
-}
-