Fix some warnings
This commit is contained in:
parent
6068bb09dc
commit
b55d956b83
|
@ -93,7 +93,7 @@ void MatroskaContainer::validateIndex()
|
|||
static const string context("validating Matroska file index (cues)");
|
||||
bool cuesElementsFound = false;
|
||||
if(m_firstElement) {
|
||||
unordered_set<int> ids;
|
||||
unordered_set<EbmlElement::identifierType> ids;
|
||||
bool cueTimeFound = false, cueTrackPositionsFound = false;
|
||||
unique_ptr<EbmlElement> clusterElement;
|
||||
uint64 pos, prevClusterSize = 0, currentOffset = 0;
|
||||
|
@ -785,10 +785,10 @@ struct SegmentData
|
|||
clusterEndOffset(0),
|
||||
startOffset(0),
|
||||
newPadding(0),
|
||||
sizeDenotationLength(0),
|
||||
totalDataSize(0),
|
||||
totalSize(0),
|
||||
newDataOffset(0)
|
||||
newDataOffset(0),
|
||||
sizeDenotationLength(0)
|
||||
{}
|
||||
|
||||
/// \brief whether CRC-32 checksum is present
|
||||
|
@ -811,14 +811,14 @@ struct SegmentData
|
|||
uint64 startOffset;
|
||||
/// \brief padding (in the new file)
|
||||
uint64 newPadding;
|
||||
/// \brief header size (in the new file)
|
||||
byte sizeDenotationLength;
|
||||
/// \brief total size of the segment data (in the new file, excluding header)
|
||||
uint64 totalDataSize;
|
||||
/// \brief total size of the segment data (in the new file, including header)
|
||||
uint64 totalSize;
|
||||
/// \brief data offset of the segment in the new file
|
||||
uint64 newDataOffset;
|
||||
/// \brief header size (in the new file)
|
||||
byte sizeDenotationLength;
|
||||
};
|
||||
|
||||
void MatroskaContainer::internalMakeFile()
|
||||
|
@ -1036,16 +1036,14 @@ calculateSegmentData:
|
|||
SegmentData &segment = segmentData[segmentIndex];
|
||||
|
||||
// parse original "Cues"-element (if present)
|
||||
if(!segment.cuesElement) {
|
||||
if((segment.cuesElement = level0Element->childById(MatroskaIds::Cues))) {
|
||||
try {
|
||||
segment.cuesUpdater.parse(segment.cuesElement);
|
||||
} catch(const Failure &) {
|
||||
addNotifications(segment.cuesUpdater);
|
||||
throw;
|
||||
}
|
||||
if(!segment.cuesElement && (segment.cuesElement = level0Element->childById(MatroskaIds::Cues))) {
|
||||
try {
|
||||
segment.cuesUpdater.parse(segment.cuesElement);
|
||||
} catch(const Failure &) {
|
||||
addNotifications(segment.cuesUpdater);
|
||||
throw;
|
||||
}
|
||||
addNotifications(segment.cuesUpdater);
|
||||
}
|
||||
|
||||
// get first "Cluster"-element
|
||||
|
@ -1724,7 +1722,7 @@ nonRewriteCalculations:
|
|||
if(level2Element->dataSize() < sizeLength) {
|
||||
// can't update position -> void position elements ("Position"-elements seem a bit useless anyways)
|
||||
outputStream.seekp(level2Element->startOffset());
|
||||
outputStream.put(EbmlIds::Void);
|
||||
outputStream.put(static_cast<char>(EbmlIds::Void));
|
||||
} else {
|
||||
// update position
|
||||
outputStream.seekp(level2Element->dataOffset());
|
||||
|
@ -1795,7 +1793,7 @@ nonRewriteCalculations:
|
|||
updateStatus("Reparsing output file ...");
|
||||
if(rewriteRequired) {
|
||||
// report new size
|
||||
fileInfo().reportSizeChanged(outputStream.tellp());
|
||||
fileInfo().reportSizeChanged(static_cast<uint64>(outputStream.tellp()));
|
||||
|
||||
// "save as path" is now the regular path
|
||||
if(!fileInfo().saveFilePath().empty()) {
|
||||
|
@ -1814,7 +1812,7 @@ nonRewriteCalculations:
|
|||
// -> close stream before truncating
|
||||
outputStream.close();
|
||||
// -> truncate file
|
||||
if(truncate(fileInfo().path().c_str(), newSize) == 0) {
|
||||
if(truncate(fileInfo().path().c_str(), static_cast<iostream::off_type>(newSize)) == 0) {
|
||||
fileInfo().reportSizeChanged(newSize);
|
||||
} else {
|
||||
addNotification(NotificationType::Critical, "Unable to truncate the file.", context);
|
||||
|
|
|
@ -77,7 +77,7 @@ void Mp4Container::internalParseHeader()
|
|||
m_firstElement->parse();
|
||||
Mp4Atom *ftypAtom = m_firstElement->siblingById(Mp4AtomIds::FileType, true);
|
||||
if(ftypAtom) {
|
||||
stream().seekg(ftypAtom->dataOffset());
|
||||
stream().seekg(static_cast<iostream::off_type>(ftypAtom->dataOffset()));
|
||||
m_doctype = reader().readString(4);
|
||||
m_version = reader().readUInt32BE();
|
||||
} else {
|
||||
|
@ -124,7 +124,7 @@ void Mp4Container::internalParseTracks()
|
|||
// get mvhd atom which holds overall track information
|
||||
if(Mp4Atom *mvhdAtom = moovAtom->childById(Mp4AtomIds::MovieHeader)) {
|
||||
if(mvhdAtom->dataSize() > 0) {
|
||||
stream().seekg(mvhdAtom->dataOffset());
|
||||
stream().seekg(static_cast<iostream::off_type>(mvhdAtom->dataOffset()));
|
||||
byte version = reader().readByte();
|
||||
if((version == 1 && mvhdAtom->dataSize() >= 32) || (mvhdAtom->dataSize() >= 20)) {
|
||||
stream().seekg(3, ios_base::cur); // skip flags
|
||||
|
@ -157,7 +157,7 @@ void Mp4Container::internalParseTracks()
|
|||
if(Mp4Atom *mehdAtom = moovAtom->subelementByPath({Mp4AtomIds::MovieExtends, Mp4AtomIds::MovieExtendsHeader})) {
|
||||
m_fragmented = true;
|
||||
if(mehdAtom->dataSize() > 0) {
|
||||
stream().seekg(mehdAtom->dataOffset());
|
||||
stream().seekg(static_cast<iostream::off_type>(mehdAtom->dataOffset()));
|
||||
unsigned int durationSize = reader().readByte() == 1u ? 8u : 4u; // duration size depends on atom version
|
||||
if(mehdAtom->dataSize() >= 4 + durationSize) {
|
||||
stream().seekg(3, ios_base::cur); // skip flags
|
||||
|
@ -772,7 +772,7 @@ calculatePadding:
|
|||
outputWriter.writeUInt32BE(Mp4AtomIds::Free);
|
||||
break;
|
||||
default:
|
||||
outputStream.seekp(level0Atom->totalSize(), ios_base::cur);
|
||||
outputStream.seekp(static_cast<iostream::off_type>(level0Atom->totalSize()), ios_base::cur);
|
||||
}
|
||||
if(level0Atom == lastAtomToBeWritten) {
|
||||
break;
|
||||
|
@ -786,7 +786,7 @@ calculatePadding:
|
|||
updateStatus("Reparsing output file ...");
|
||||
if(rewriteRequired) {
|
||||
// report new size
|
||||
fileInfo().reportSizeChanged(outputStream.tellp());
|
||||
fileInfo().reportSizeChanged(static_cast<iostream::off_type>(outputStream.tellp()));
|
||||
// "save as path" is now the regular path
|
||||
if(!fileInfo().saveFilePath().empty()) {
|
||||
fileInfo().reportPathChanged(fileInfo().saveFilePath());
|
||||
|
@ -803,7 +803,7 @@ calculatePadding:
|
|||
// -> close stream before truncating
|
||||
outputStream.close();
|
||||
// -> truncate file
|
||||
if(truncate(fileInfo().path().c_str(), newSize) == 0) {
|
||||
if(truncate(fileInfo().path().c_str(), static_cast<iostream::off_type>(newSize)) == 0) {
|
||||
fileInfo().reportSizeChanged(newSize);
|
||||
} else {
|
||||
addNotification(NotificationType::Critical, "Unable to truncate the file.", context);
|
||||
|
@ -901,7 +901,7 @@ void Mp4Container::updateOffsets(const std::vector<int64> &oldMdatOffsets, const
|
|||
tfhdAtom->parse();
|
||||
++tfhdAtomCount;
|
||||
if(tfhdAtom->dataSize() >= 8) {
|
||||
stream().seekg(tfhdAtom->dataOffset() + 1);
|
||||
stream().seekg(static_cast<iostream::off_type>(tfhdAtom->dataOffset()) + 1);
|
||||
uint32 flags = reader().readUInt24BE();
|
||||
if(flags & 1) {
|
||||
if(tfhdAtom->dataSize() >= 16) {
|
||||
|
@ -911,7 +911,7 @@ void Mp4Container::updateOffsets(const std::vector<int64> &oldMdatOffsets, const
|
|||
iOld != end; ++iOld, ++iNew) {
|
||||
if(off >= static_cast<uint64>(*iOld)) {
|
||||
off += (*iNew - *iOld);
|
||||
stream().seekp(tfhdAtom->dataOffset() + 8);
|
||||
stream().seekp(static_cast<iostream::off_type>(tfhdAtom->dataOffset()) + 8);
|
||||
writer().writeUInt64BE(off);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue