[vlc-commits] adaptive: honor --preferred-resolution
Pierre Ynard
git at videolan.org
Mon Nov 9 20:46:09 CET 2020
vlc/vlc-3.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun Nov 8 01:15:01 2020 +0100| [6f5aa2deb343f801efde4bfd67d000b5ce4f0110] | 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>
(cherry picked from commit 1d55df153a4e2ed5f3dcdb5c6cccbd9dbefe8b98)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=6f5aa2deb343f801efde4bfd67d000b5ce4f0110
---
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 e2d513c23d..302987813d 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -838,8 +838,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