[vlc-commits] demux/adaptive: only use width/height for selection if explicitly set

Filip Roséen git at videolan.org
Fri Aug 5 15:54:33 CEST 2016


vlc | branch: master | Filip Roséen <filip at videolabs.io> | Wed Jul 13 22:02:46 2016 +0200| [f2de0fc0fa07d2a8f3ce80d2a892f1326653632c] | committer: Francois Cartegnie

demux/adaptive: only use width/height for selection if explicitly set

Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>

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

 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())



More information about the vlc-commits mailing list