Skip to content

Commit

Permalink
track/seratomarkers2: Improve parser warnings in SeratoMarkers2 class
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Oct 22, 2019
1 parent df45058 commit f4bd575
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/track/seratomarkers2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,16 @@ quint32 SeratoMarkers2LoopEntry::length() const {

bool SeratoMarkers2::parse(SeratoMarkers2* seratoMarkers2, const QByteArray& outerData) {
if (!outerData.startsWith("\x01\x01")) {
qWarning() << "Unknown outer Serato Markers2 tag version";
qWarning() << "Parsing SeratoMarkers2 failed:"
<< "Unknown outer Serato Markers2 tag version";
return false;
}

const auto data = QByteArray::fromBase64(outerData.mid(2));

if (!data.startsWith("\x01\x01")) {
qWarning() << "Unknown inner Serato Markers2 tag version";
qWarning() << "Parsing SeratoMarkers2 failed:"
<< "Unknown inner Serato Markers2 tag version";
return false;
}

Expand Down Expand Up @@ -316,6 +318,8 @@ bool SeratoMarkers2::parse(SeratoMarkers2* seratoMarkers2, const QByteArray& out
}

if(!pEntry) {
qWarning() << "Parsing SeratoMarkers2 failed:"
<< "Unable to parse entry of type " << entryType;
return false;
}
entries.append(pEntry);
Expand Down

0 comments on commit f4bd575

Please sign in to comment.