From: Steve Lhomme Date: Sun, 16 Oct 2022 06:58:12 +0000 (+0200) Subject: avoid using protected member variables X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86f1cabbbe2ed5cea41cd6756cd0203ff953059e;p=libmatroska avoid using protected member variables If libebml is compiled in strict mode, these fields can't be accessed, but we can still access them with the proper methods. --- diff --git a/src/KaxCluster.cpp b/src/KaxCluster.cpp index 48af57e..a4f1624 100644 --- a/src/KaxCluster.cpp +++ b/src/KaxCluster.cpp @@ -156,10 +156,10 @@ filepos_t KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bS if (EbmlId(*Trk) == EBML_ID(KaxTrackEntry)) { auto entry = static_cast(Trk); auto tracknum = static_cast(entry->TrackNumber()); - auto track = std::find_if(ElementList.begin(), ElementList.end(), [=](EbmlElement *element) + auto track = std::find_if(GetElementList().begin(), GetElementList().end(), [=](EbmlElement *element) { return EbmlId(*element) == EBML_ID(KaxBlockGroup) && static_cast(element)->TrackNumber() == tracknum; }); // the track wasn't found in this cluster - if (track == ElementList.end()) { + if (track == GetElementList().end()) { auto SilentTracks = static_cast(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks))); assert(SilentTracks); // the flag bSilentTracksUsed should be set when creating the Cluster auto trackelt = static_cast(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber))); @@ -172,7 +172,7 @@ filepos_t KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bS Result = EbmlMaster::Render(output, bSaveDefault); // For all Blocks add their position on the CueEntry - for (const auto& element : ElementList) { + for (const auto& element : GetElementList()) { if (EbmlId(*element) == EBML_ID(KaxBlockGroup)) { CueToUpdate.PositionSet(*static_cast(element)); } @@ -267,7 +267,7 @@ KaxBlockGroup & KaxCluster::GetNewBlock() void KaxCluster::ReleaseFrames() { - for (const auto& element : ElementList) { + for (const auto& element : GetElementList()) { if (EbmlId(*element) == EBML_ID(KaxBlockGroup)) { static_cast(element)->ReleaseFrames(); }