[vlc-commits] demux: adaptative: add missing adaptationSet by ID

Francois Cartegnie git at videolan.org
Tue Sep 22 00:38:51 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Sep 16 15:40:14 2015 +0200| [c8be3492449cff67809f6e4024373ca6f59cd938] | committer: Francois Cartegnie

demux: adaptative: add missing adaptationSet by ID

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

 modules/demux/adaptative/playlist/BasePeriod.cpp |   11 +++++++++++
 modules/demux/adaptative/playlist/BasePeriod.h   |    1 +
 2 files changed, 12 insertions(+)

diff --git a/modules/demux/adaptative/playlist/BasePeriod.cpp b/modules/demux/adaptative/playlist/BasePeriod.cpp
index 3a7e4f5..50e7dc3 100644
--- a/modules/demux/adaptative/playlist/BasePeriod.cpp
+++ b/modules/demux/adaptative/playlist/BasePeriod.cpp
@@ -82,6 +82,17 @@ void BasePeriod::addAdaptationSet(BaseAdaptationSet *adaptationSet)
     }
 }
 
+BaseAdaptationSet *BasePeriod::getAdaptationSetByID(const ID &id)
+{
+    std::vector<BaseAdaptationSet*>::const_iterator it;
+    for(it = adaptationSets.begin(); it!= adaptationSets.end(); ++it)
+    {
+        if( (*it)->getID() == id )
+            return *it;
+    }
+    return NULL;
+}
+
 BaseAdaptationSet * BasePeriod::getAdaptationSet(adaptative::StreamType type) const
 {
     std::vector<BaseAdaptationSet *>::const_iterator it;
diff --git a/modules/demux/adaptative/playlist/BasePeriod.h b/modules/demux/adaptative/playlist/BasePeriod.h
index 606cc4a..e0bfc2c 100644
--- a/modules/demux/adaptative/playlist/BasePeriod.h
+++ b/modules/demux/adaptative/playlist/BasePeriod.h
@@ -43,6 +43,7 @@ namespace adaptative
 
                 const std::vector<BaseAdaptationSet *>& getAdaptationSets   () const;
                 const std::vector<BaseAdaptationSet *>  getAdaptationSets   (StreamType) const;
+                BaseAdaptationSet *                 getAdaptationSetByID(const ID &);
                 BaseAdaptationSet *                 getAdaptationSet    (StreamType) const;
                 void                                addAdaptationSet    (BaseAdaptationSet *AdaptationSet);
                 void                                debug               (vlc_object_t *,int = 0) const;



More information about the vlc-commits mailing list