assert(RefdBlock != nullptr);
assert(ParentBlock != nullptr);
- const KaxInternalBlock &block = *RefdBlock;
- *static_cast<EbmlSInteger*>(this) = (static_cast<int64>(block.GlobalTimecode()) - static_cast<int64>(ParentBlock->GlobalTimecode())) / static_cast<int64>(ParentBlock->GlobalTimecodeScale());
+ const auto &block = static_cast<const KaxInternalBlock&>(*RefdBlock);
+ SetValue(static_cast<int64>(block.GlobalTimecode()) - static_cast<int64>(ParentBlock->GlobalTimecode()) / static_cast<int64>(ParentBlock->GlobalTimecodeScale()));
}
return EbmlSInteger::UpdateSize(bSaveDefault, bForceRender);
}
// look for the element in the temporary references
auto it = std::find_if(myTempReferences.begin(), myTempReferences.end(),
[&](const KaxBlockBlob *myTempReference)
- { const KaxInternalBlock &refTmp = *myTempReference;
+ { const auto &refTmp = static_cast<const KaxInternalBlock &>(*myTempReference);
return refTmp.GlobalTimecode() == BlockRef.GlobalTimecode()
&& refTmp.TrackNum() == BlockRef.TrackNumber(); });
void KaxCuePoint::PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalTimecodeScale)
{
- const KaxInternalBlock &BlockReference = BlobReference;
+ const auto &BlockReference = static_cast<const KaxInternalBlock&>(BlobReference);
const KaxBlockGroup *BlockGroupPointer = nullptr;
if (!BlobReference.IsSimpleBlock()) {
- const KaxBlockGroup &BlockGroup = BlobReference;
- BlockGroupPointer = & BlockGroup;
+ const auto &BlockGroup = static_cast<const KaxBlockGroup&>(BlobReference);
+ BlockGroupPointer = &BlockGroup;
}
PositionSet(BlockReference, BlockGroupPointer, GlobalTimecodeScale);
}
*/
void KaxCueReference::AddReference(const KaxBlockBlob & BlockReference, uint64 GlobalTimecodeScale)
{
- const KaxInternalBlock & theBlock = BlockReference;
+ const auto& theBlock = static_cast<const KaxInternalBlock&>(BlockReference);
auto & NewTime = GetChild<KaxCueRefTime>(*this);
*static_cast<EbmlUInteger*>(&NewTime) = theBlock.GlobalTimecode() / GlobalTimecodeScale;