Commit 00c6ac90 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptive: use vlc_url_resolve (fix #19164)

parent 59a3ab81
......@@ -25,6 +25,8 @@
#include "BaseRepresentation.h"
#include "SegmentTemplate.h"
#include <vlc_url.h>
using namespace adaptive::playlist;
Url::Url()
......@@ -109,14 +111,29 @@ std::string Url::toString(size_t index, const BaseRepresentation *rep) const
{
std::string ret;
std::vector<Component>::const_iterator it;
for(it = components.begin(); it != components.end(); ++it)
{
std::string part;
const Component *comp = & (*it);
if(rep)
ret.append(rep->contextualize(index, comp->component, comp->templ));
part = rep->contextualize(index, comp->component, comp->templ);
else
ret.append(comp->component);
part = comp->component;
if( ret.empty() )
ret = part;
else
{
char *psz_resolved = vlc_uri_resolve( ret.c_str(), part.c_str() );
if( psz_resolved )
{
ret = std::string( psz_resolved );
free( psz_resolved );
}
}
}
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment