Fix some style issues

This commit is contained in:
Martchus 2017-09-14 18:19:30 +02:00
parent 9153e726d5
commit a1547f9365
5 changed files with 7 additions and 8 deletions

View File

@ -47,13 +47,12 @@ void MatroskaTagField::reparse(EbmlElement &simpleTagElement, bool parseNestedFi
string context("parsing Matroska tag field");
clear();
simpleTagElement.parse();
EbmlElement *child = simpleTagElement.firstChild();
bool tagDefaultFound = false;
while(child) {
for(EbmlElement *child = simpleTagElement.firstChild(); child; child = child = child->nextSibling()) {
try {
child->parse();
} catch (Failure &) {
addNotification(NotificationType::Critical, "Unable to parse childs of \"SimpleTag\"-element.", context);
} catch (const Failure &) {
addNotification(NotificationType::Critical, "Unable to parse children of \"SimpleTag\"-element.", context);
break;
}
switch(child->id()) {
@ -115,7 +114,6 @@ void MatroskaTagField::reparse(EbmlElement &simpleTagElement, bool parseNestedFi
default:
addNotification(NotificationType::Warning, argsToString("\"SimpleTag\"-element contains unknown element ", child->idToString(), " at ", child->startOffset(), ". It will be ignored."), context);
}
child = child->nextSibling();
}
}

View File

@ -435,7 +435,7 @@ void MatroskaTrack::internalParseHeader()
switch(m_mediaType) {
case MediaType::Video:
if(!m_fps && defaultDuration) {
m_fps = 1000000000.0 / static_cast<double>(defaultDuration);
m_fps = 1000000000.0 / defaultDuration;
}
break;
default:

View File

@ -157,7 +157,7 @@ void Mp4Atom::seekBackAndWriteAtomSize64(std::ostream &stream, const ostream::po
*/
void Mp4Atom::makeHeader(uint64 size, uint32 id, BinaryWriter &writer)
{
if(size < 0xFFFFFFFF) {
if(size < numeric_limits<uint32>::max()) {
writer.writeUInt32BE(static_cast<uint32>(size));
writer.writeUInt32BE(id);
} else {

View File

@ -100,7 +100,7 @@ inline std::string Mp4Atom::idToString() const
*/
inline void Mp4Atom::addHeaderSize(uint64 &dataSize)
{
dataSize += dataSize < 0xFFFFFFF7 ? 8 : 16;
dataSize += (dataSize < 0xFFFFFFF7 ? 8 : 16);
}
}

View File

@ -680,6 +680,7 @@ calculatePadding:
origMediaDataOffsets.push_back(level0Atom->startOffset());
newMediaDataOffsets.push_back(outputStream.tellp());
}
FALLTHROUGH;
default:
// update status
updateStatus("Writing atom: " + level0Atom->idToString());