Browse Source

demux: adaptive: inherit/use playlist cookie jar (fix #9632)

pull/59/merge
Francois Cartegnie 9 years ago
parent
commit
c19e60abc5
  1. 2
      modules/demux/adaptive/adaptive.cpp
  2. 9
      modules/demux/adaptive/http/AuthStorage.cpp
  3. 2
      modules/demux/adaptive/http/AuthStorage.hpp

2
modules/demux/adaptive/adaptive.cpp

@ -152,7 +152,7 @@ static int Open(vlc_object_t *p_obj)
}
PlaylistManager *p_manager = NULL;
AuthStorage *authStorage = new AuthStorage();
AuthStorage *authStorage = new AuthStorage(p_obj);
char *psz_logic = var_InheritString(p_obj, "adaptive-logic");
AbstractAdaptationLogic::LogicType logic = AbstractAdaptationLogic::Default;

9
modules/demux/adaptive/http/AuthStorage.cpp

@ -26,14 +26,17 @@
using namespace adaptive::http;
AuthStorage::AuthStorage()
AuthStorage::AuthStorage( vlc_object_t *p_obj )
{
p_cookies_jar = vlc_http_cookies_new();
if ( var_InheritBool( p_obj, "http-forward-cookies" ) )
p_cookies_jar = static_cast<vlc_http_cookie_jar_t *>
(var_InheritAddress( p_obj, "http-cookies" ));
else
p_cookies_jar = NULL;
}
AuthStorage::~AuthStorage()
{
vlc_http_cookies_destroy( p_cookies_jar );
}
void AuthStorage::addCookie( const std::string &cookie, const ConnectionParams &params )

2
modules/demux/adaptive/http/AuthStorage.hpp

@ -34,7 +34,7 @@ namespace adaptive
class AuthStorage
{
public:
AuthStorage();
AuthStorage(vlc_object_t *p_obj);
~AuthStorage();
void addCookie( const std::string &cookie, const ConnectionParams & );
std::string getCookie( const ConnectionParams &, bool secure );

Loading…
Cancel
Save