Commit a9921fc3 authored by Jean-Paul Saman's avatar Jean-Paul Saman

stream_filter: httplive.c: allow username/password in URI

Allow using of username/password in URI for downloading segments or playlist files.
parent f1127f73
......@@ -861,6 +861,7 @@ static void* hls_Thread(vlc_object_t *p_this)
if (now >= p_sys->wakeup)
{
#if 0
/** FIXME: Implement m3u8 playlist reloading */
if (!hls_ReloadPlaylist(client->s))
{
/* No change in playlist, then backoff */
......@@ -911,11 +912,24 @@ static int AccessOpen(stream_t *s, vlc_url_t *url)
{
p_sys->p_access->psz_access = strdup(url->psz_protocol);
p_sys->p_access->psz_filepath = strdup(url->psz_path);
if (url->psz_password || url->psz_username)
{
if (asprintf(&p_sys->p_access->psz_location, "%s:%s@%s%s",
url->psz_username, url->psz_password,
url->psz_host, url->psz_path) < 0)
{
msg_Err(s, "creating http access module");
goto fail;
}
}
else
{
if (asprintf(&p_sys->p_access->psz_location, "%s%s", url->psz_host, url->psz_path) < 0)
{
msg_Err(s, "creating http access module");
goto fail;
}
}
vlc_object_attach(p_sys->p_access, s);
p_sys->p_access->p_module =
module_need(p_sys->p_access, "access", "http", true);
......@@ -1372,8 +1386,6 @@ static int segment_Seek(stream_t *s, uint64_t pos)
if (segment == NULL)
return VLC_EGENERIC;
msg_Err(s, "seeking in segment %d/%"PRIu64, n, segment->size);
vlc_mutex_lock(&segment->lock);
length += segment->size;
uint64_t size = segment->size -segment->data->i_buffer;
......
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