Skip to content

Commit

Permalink
Merge pull request #8 from DolbyLaboratories/dolby/atmos_storage/asdc…
Browse files Browse the repository at this point in the history
…plib_integration/add_km_logs

Add KM logs and remove semicolon from pre-processor directive
  • Loading branch information
jhursty committed Aug 27, 2021
2 parents ef58812 + 6b438cf commit 1f8506f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/Index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "MXF.h"
const ui32_t kl_length = ASDCP::SMPTE_UL_LENGTH + ASDCP::MXF_BER_LENGTH;
#include "KM_log.h"

const ui32_t kl_length = ASDCP::SMPTE_UL_LENGTH + ASDCP::MXF_BER_LENGTH;

using Kumu::DefaultLogSink;
//
ASDCP::MXF::IndexTableSegment::IndexTableSegment(const Dictionary* d) :
InterchangeObject(d), RtFileOffset(0), RtEntryOffset(0),
Expand Down Expand Up @@ -118,10 +120,15 @@ ASDCP::MXF::IndexTableSegment::InitFromTLVSet(TLVReader& TLVSet)

if ( decoder_item_size < item_size )
{
TLVSet.SkipOffset(item_size - decoder_item_size);
rc = TLVSet.SkipOffset(item_size - decoder_item_size);
}
}
}
if (IndexEntryArray.size() != item_count)
{
DefaultLogSink().Error("Malformed index table segment, could not decode all IndexEntries.\n");
return RESULT_KLV_CODING;
}
}
}
}
Expand Down Expand Up @@ -196,7 +203,7 @@ ASDCP::MXF::IndexTableSegment::Dump(FILE* stream)
}
else
{
fprintf(stream, " IndexEntryArray: %zu entries\n", IndexEntryArray.size());
fprintf(stream, " IndexEntryArray: %lu entries\n", IndexEntryArray.size());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/KM_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <string>

#define KM_DECLARE_RESULT(sym, i, l) const Result_t RESULT_##sym = Result_t(i, #sym, l);
#define KM_DECLARE_RESULT(sym, i, l) const Result_t RESULT_##sym = Result_t(i, #sym, l)

namespace Kumu
{
Expand Down
18 changes: 18 additions & 0 deletions src/KM_xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,9 @@ Kumu::XMLElement::ParseFirstFromString(const char* document, ui32_t doc_len)

if ( ! XML_Parse(Parser, document, doc_len, 1) )
{
DefaultLogSink().Error("XML Parse error on line %d: %s\n",
XML_GetCurrentLineNumber(Parser),
XML_ErrorString(XML_GetErrorCode(Parser)));
XML_ParserFree(Parser);
return false;
}
Expand Down Expand Up @@ -1023,8 +1026,23 @@ Kumu::XMLElement::ParseFirstFromString(const char* document, ui32_t doc_len)
++errorCount;
}
}
catch (const XMLException& e)
{
char* message = XMLString::transcode(e.getMessage());
DefaultLogSink().Error("Parser error: %s\n", message);
XMLString::release(&message);
errorCount++;
}
catch (const SAXParseException& e)
{
char* message = XMLString::transcode(e.getMessage());
DefaultLogSink().Error("Parser error: %s at line %d\n", message, e.getLineNumber());
XMLString::release(&message);
errorCount++;
}
catch (...)
{
DefaultLogSink().Error("Unexpected XML parser error\n");
errorCount++;
}

Expand Down

0 comments on commit 1f8506f

Please sign in to comment.