[vlc-devel] [PATCH 2/3] demux/adaptive: only use width/height for selection if explicitly set

Filip Roséen filip at videolabs.io
Wed Jul 13 22:02:46 CEST 2016


---
 modules/demux/adaptive/logic/Representationselectors.cpp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/modules/demux/adaptive/logic/Representationselectors.cpp b/modules/demux/adaptive/logic/Representationselectors.cpp
index 8bada75..298c346 100644
--- a/modules/demux/adaptive/logic/Representationselectors.cpp
+++ b/modules/demux/adaptive/logic/Representationselectors.cpp
@@ -66,10 +66,19 @@ BaseRepresentation * RepresentationSelector::select(BaseAdaptationSet *adaptSet,
     /* subset matching WxH */
     std::vector<BaseRepresentation *> reps = adaptSet->getRepresentations();
     std::vector<BaseRepresentation *>::const_iterator repIt;
-    for(repIt=reps.begin(); repIt!=reps.end(); ++repIt)
+
+    if(width != 0 || height != 0)
     {
-        if((*repIt)->getWidth() == width && (*repIt)->getHeight() == height)
+        for(repIt=reps.begin(); repIt!=reps.end(); ++repIt)
+        {
+            if(width && (*repIt)->getWidth() != width)
+                continue;
+
+            if(height && (*repIt)->getHeight() != height)
+                continue;
+
             resMatchReps.push_back(*repIt);
+        }
     }
 
     if(resMatchReps.empty())
-- 
2.9.0



More information about the vlc-devel mailing list