[vlc-commits] adaptive: honor --preferred-resolution

Pierre Ynard via vlc-devel git at videolan.org
Mon Nov 9 10:22:06 CET 2020


vlc | branch: master | Pierre Ynard via vlc-devel <vlc-devel at videolan.org> | Sun Nov  8 01:15:01 2020 +0100| [f26398c16aadbbdd47e5e5805c7c1acd73911cab] | committer: Francois Cartegnie

adaptive: honor --preferred-resolution

--adaptive-maxheight still takes precedence if set.

Fixes #21828

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

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

 modules/demux/adaptive/PlaylistManager.cpp | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index 0e7b62a141..164ba0949e 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -847,8 +847,19 @@ AbstractAdaptationLogic *PlaylistManager::createLogic(AbstractAdaptationLogic::L
 
     if(logic)
     {
-        logic->setMaxDeviceResolution( var_InheritInteger(p_demux, "adaptive-maxwidth"),
-                                       var_InheritInteger(p_demux, "adaptive-maxheight") );
+        int w = var_InheritInteger(p_demux, "adaptive-maxwidth");
+        int h = var_InheritInteger(p_demux, "adaptive-maxheight");
+        if(h == 0)
+        {
+            h = var_InheritInteger(p_demux, "preferred-resolution");
+            /* Adapt for slightly different minimum/maximum semantics */
+            if(h == -1)
+                h = 0;
+            else if(h == 0)
+                h = 1;
+        }
+
+        logic->setMaxDeviceResolution(w, h);
     }
 
     return logic;



More information about the vlc-commits mailing list