Apply cmake-format and clang-format
This commit is contained in:
parent
3288d49d62
commit
c17db5f2f6
|
@ -176,7 +176,8 @@ set(META_REQUIRED_CPP_UNIT_VERSION 1.14.0)
|
|||
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
|
||||
|
||||
# find c++utilities
|
||||
set(CONFIGURATION_PACKAGE_SUFFIX "" CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities")
|
||||
set(CONFIGURATION_PACKAGE_SUFFIX ""
|
||||
CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities")
|
||||
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
|
||||
use_cpp_utilities(VISIBILITY PUBLIC)
|
||||
|
||||
|
|
|
@ -592,7 +592,8 @@ std::unique_ptr<Mpeg4ElementaryStreamInfo> Mp4Track::parseMpeg4ElementaryStreamI
|
|||
if (esInfo->ocrFlag()) {
|
||||
esInfo->ocrId = reader.readUInt16BE();
|
||||
}
|
||||
for (Mpeg4Descriptor *esDescChild = esDesc.denoteFirstChild(static_cast<std::uint32_t>(static_cast<std::uint64_t>(reader.stream()->tellg()) - esDesc.startOffset()));
|
||||
for (Mpeg4Descriptor *esDescChild
|
||||
= esDesc.denoteFirstChild(static_cast<std::uint32_t>(static_cast<std::uint64_t>(reader.stream()->tellg()) - esDesc.startOffset()));
|
||||
esDescChild; esDescChild = esDescChild->nextSibling()) {
|
||||
esDescChild->parse(diag);
|
||||
switch (esDescChild->id()) {
|
||||
|
@ -1201,9 +1202,11 @@ void Mp4Track::makeTrackHeader(Diagnostics &diag)
|
|||
const auto creationTime = static_cast<std::uint64_t>((m_creationTime - startDate).totalSeconds());
|
||||
const auto modificationTime = static_cast<std::uint64_t>((m_modificationTime - startDate).totalSeconds());
|
||||
const auto duration = static_cast<std::uint64_t>(m_duration.totalSeconds() * m_timeScale);
|
||||
const std::uint8_t version = (info.version == 0) && (creationTime > numeric_limits<std::uint32_t>::max()
|
||||
|| modificationTime > numeric_limits<std::uint32_t>::max()
|
||||
|| duration > numeric_limits<std::uint32_t>::max()) ? 1 : info.version;
|
||||
const std::uint8_t version = (info.version == 0)
|
||||
&& (creationTime > numeric_limits<std::uint32_t>::max() || modificationTime > numeric_limits<std::uint32_t>::max()
|
||||
|| duration > numeric_limits<std::uint32_t>::max())
|
||||
? 1
|
||||
: info.version;
|
||||
|
||||
// make version and flags
|
||||
writer().writeByte(version);
|
||||
|
@ -1276,9 +1279,10 @@ void Mp4Track::makeMedia(Diagnostics &diag)
|
|||
const auto creationTime = static_cast<std::uint64_t>((m_creationTime - startDate).totalSeconds());
|
||||
const auto modificationTime = static_cast<std::uint64_t>((m_modificationTime - startDate).totalSeconds());
|
||||
const auto duration = static_cast<std::uint64_t>(m_duration.totalSeconds() * m_timeScale);
|
||||
const std::uint8_t version = (creationTime > numeric_limits<std::uint32_t>::max()
|
||||
|| modificationTime > numeric_limits<std::uint32_t>::max()
|
||||
|| duration > numeric_limits<std::uint32_t>::max()) ? 1 : 0;
|
||||
const std::uint8_t version = (creationTime > numeric_limits<std::uint32_t>::max() || modificationTime > numeric_limits<std::uint32_t>::max()
|
||||
|| duration > numeric_limits<std::uint32_t>::max())
|
||||
? 1
|
||||
: 0;
|
||||
writer().writeUInt32BE(version != 0 ? 44 : 32); // size
|
||||
writer().writeUInt32BE(Mp4AtomIds::MediaHeader);
|
||||
writer().writeByte(version); // version
|
||||
|
@ -1311,7 +1315,8 @@ void Mp4Track::makeMedia(Diagnostics &diag)
|
|||
language = 0;
|
||||
break;
|
||||
}
|
||||
diag.emplace_back(DiagLevel::Warning, "Assigned language \"" % m_language + "\" is of an invalid format. Setting language to undefined.", "making mdhd atom");
|
||||
diag.emplace_back(DiagLevel::Warning, "Assigned language \"" % m_language + "\" is of an invalid format. Setting language to undefined.",
|
||||
"making mdhd atom");
|
||||
language = 0x55C4; // und(efined)
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -56,8 +56,7 @@ void MpegAudioFrameStream::internalParseHeader(Diagnostics &diag)
|
|||
m_size = xingSize;
|
||||
}
|
||||
}
|
||||
m_bitrate = frame.isXingFramefieldPresent()
|
||||
? ((static_cast<double>(m_size) * 8.0)
|
||||
m_bitrate = frame.isXingFramefieldPresent() ? ((static_cast<double>(m_size) * 8.0)
|
||||
/ (static_cast<double>(frame.xingFrameCount() * frame.sampleCount()) / static_cast<double>(frame.samplingFrequency())) / 1024.0)
|
||||
: frame.bitrate();
|
||||
m_duration = TimeSpan::fromSeconds(static_cast<double>(m_size) / (m_bytesPerSecond = static_cast<std::uint32_t>(m_bitrate * 125)));
|
||||
|
|
|
@ -202,8 +202,7 @@ void WaveAudioStream::internalParseHeader(Diagnostics &diag)
|
|||
MpegAudioFrame frame;
|
||||
frame.parseHeader(m_reader, diag);
|
||||
MpegAudioFrameStream::addInfo(frame, *this);
|
||||
m_bitrate = frame.isXingFramefieldPresent()
|
||||
? ((static_cast<double>(m_size) * 8.0)
|
||||
m_bitrate = frame.isXingFramefieldPresent() ? ((static_cast<double>(m_size) * 8.0)
|
||||
/ (static_cast<double>(frame.xingFrameCount() * frame.sampleCount()) / static_cast<double>(frame.samplingFrequency())) / 1024.0)
|
||||
: frame.bitrate();
|
||||
m_bytesPerSecond = static_cast<std::uint32_t>(m_bitrate * 125);
|
||||
|
|
Loading…
Reference in New Issue