[vlc-commits] adaptive: honor --preferred-resolution
Pierre Ynard
git at videolan.org
Mon Nov 9 16:42:02 CET 2020
vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun Nov 8 01:15:01 2020 +0100| [1d55df153a4e2ed5f3dcdb5c6cccbd9dbefe8b98] | 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=1d55df153a4e2ed5f3dcdb5c6cccbd9dbefe8b98
---
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