]> granicus.if.org Git - libmatroska/commitdiff
avoid using protected member variables
authorSteve Lhomme <slhomme@matroska.org>
Sun, 16 Oct 2022 06:58:12 +0000 (08:58 +0200)
committerSteve Lhomme <slhomme@matroska.org>
Sun, 16 Oct 2022 06:58:12 +0000 (08:58 +0200)
If libebml is compiled in strict mode, these fields can't be accessed, but we
can still access them with the proper methods.

src/KaxCluster.cpp

index 48af57eb38d232603a1265b3f53a49afc11b57fd..a4f1624a906cf146245ac6b052ea5ddaddf328ea 100644 (file)
@@ -156,10 +156,10 @@ filepos_t KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bS
         if (EbmlId(*Trk) == EBML_ID(KaxTrackEntry)) {
           auto entry = static_cast<KaxTrackEntry *>(Trk);
           auto tracknum = static_cast<std::uint32_t>(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<KaxBlockGroup *>(element)->TrackNumber() == tracknum;  });
           // the track wasn't found in this cluster
-          if (track == ElementList.end()) {
+          if (track == GetElementList().end()) {
             auto SilentTracks = static_cast<KaxClusterSilentTracks *>(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks)));
             assert(SilentTracks); // the flag bSilentTracksUsed should be set when creating the Cluster
             auto trackelt = static_cast<KaxClusterSilentTrackNumber *>(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<const KaxBlockGroup *>(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<KaxBlockGroup *>(element)->ReleaseFrames();
     }