[vlc-commits] demux: adaptive: change unset state variable value

Francois Cartegnie git at videolan.org
Sun Jan 29 13:35:39 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Jan 29 13:34:36 2017 +0100| [afabd229daacde724a35bf907354cc31cee7863f] | committer: Francois Cartegnie

demux: adaptive: change unset state variable value

int max not suitable for UI or command line overriding

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

 modules/demux/adaptive/adaptive.cpp                      | 6 ++----
 modules/demux/adaptive/logic/AbstractAdaptationLogic.cpp | 4 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/modules/demux/adaptive/adaptive.cpp b/modules/demux/adaptive/adaptive.cpp
index 44baedb..1ba7d97 100644
--- a/modules/demux/adaptive/adaptive.cpp
+++ b/modules/demux/adaptive/adaptive.cpp
@@ -47,8 +47,6 @@
 #include "../smooth/SmoothStream.hpp"
 #include "../smooth/playlist/Parser.hpp"
 
-#include <limits>
-
 using namespace adaptive::logic;
 using namespace adaptive::playlist;
 using namespace adaptive::xml;
@@ -113,9 +111,9 @@ vlc_module_begin ()
         set_subcategory( SUBCAT_INPUT_DEMUX )
         add_string( "adaptive-logic",  "", ADAPT_LOGIC_TEXT, NULL, false )
             change_string_list( ppsz_logics_values, ppsz_logics )
-        add_integer( "adaptive-maxwidth",  std::numeric_limits<int>::max(),
+        add_integer( "adaptive-maxwidth",  0,
                      ADAPT_WIDTH_TEXT,  ADAPT_WIDTH_TEXT,  false )
-        add_integer( "adaptive-maxheight", std::numeric_limits<int>::max(),
+        add_integer( "adaptive-maxheight", 0,
                      ADAPT_HEIGHT_TEXT, ADAPT_HEIGHT_TEXT, false )
         add_integer( "adaptive-bw",     250, ADAPT_BW_TEXT,     ADAPT_BW_LONGTEXT,     false )
         add_bool   ( "adaptive-use-access", false, ADAPT_ACCESS_TEXT, ADAPT_ACCESS_LONGTEXT, true );
diff --git a/modules/demux/adaptive/logic/AbstractAdaptationLogic.cpp b/modules/demux/adaptive/logic/AbstractAdaptationLogic.cpp
index 0b18c41..a5336d5 100644
--- a/modules/demux/adaptive/logic/AbstractAdaptationLogic.cpp
+++ b/modules/demux/adaptive/logic/AbstractAdaptationLogic.cpp
@@ -47,6 +47,6 @@ void AbstractAdaptationLogic::updateDownloadRate    (const adaptive::ID &, size_
 
 void AbstractAdaptationLogic::setMaxDeviceResolution (int w, int h)
 {
-    maxwidth = w;
-    maxheight = h;
+    maxwidth = (w > 0) ? w : std::numeric_limits<int>::max();
+    maxheight = (h > 0) ? h : std::numeric_limits<int>::max();
 }



More information about the vlc-commits mailing list