[vlc-commits] demux: adaptive: remove sets copies

Francois Cartegnie git at videolan.org
Tue Mar 2 23:44:57 UTC 2021


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Mar  2 14:39:21 2021 +0100| [7c09a9349d322729bb4fc0d2a0c26293c5151a2d] | committer: Francois Cartegnie

demux: adaptive: remove sets copies

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7c09a9349d322729bb4fc0d2a0c26293c5151a2d
---

 modules/demux/adaptive/PlaylistManager.cpp | 2 +-
 modules/demux/hls/playlist/M3U8.cpp        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index bca4b59739..4d72342388 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -116,7 +116,7 @@ bool PlaylistManager::setupPeriod()
     if(!bufferingLogic && !(bufferingLogic = createBufferingLogic()))
         return false;
 
-    std::vector<BaseAdaptationSet*> sets = currentPeriod->getAdaptationSets();
+    const std::vector<BaseAdaptationSet*> &sets = currentPeriod->getAdaptationSets();
     for(BaseAdaptationSet *set : sets)
     {
         if(set && streamFactory)
diff --git a/modules/demux/hls/playlist/M3U8.cpp b/modules/demux/hls/playlist/M3U8.cpp
index d38d139843..f07b8d95f8 100644
--- a/modules/demux/hls/playlist/M3U8.cpp
+++ b/modules/demux/hls/playlist/M3U8.cpp
@@ -45,8 +45,8 @@ bool M3U8::isLive() const
     for(itp = periods.begin(); itp != periods.end(); ++itp)
     {
         const BasePeriod *period = *itp;
-        std::vector<BaseAdaptationSet *>::const_iterator ita;
-        for(ita = period->getAdaptationSets().begin(); ita != period->getAdaptationSets().end(); ++ita)
+        const std::vector<BaseAdaptationSet *> &sets = period->getAdaptationSets();
+        for(auto ita = sets.cbegin(); ita != sets.cend(); ++ita)
         {
             BaseAdaptationSet *adaptSet = *ita;
             const std::vector<BaseRepresentation *> &reps = adaptSet->getRepresentations();



More information about the vlc-commits mailing list