[vlc-devel] [PATCH] input: Fill psz_location

Rémi Denis-Courmont remi at remlab.net
Wed Feb 20 09:03:45 CET 2019


Well, psz_location is kinda legacy now that we have the complete URL, and it cannot cope with URLs whose colon is not followed by two slashes.

So I'm not sure we should promote it really.

Le 19 février 2019 12:09:10 GMT+02:00, "Hugo Beauzée-Luyssen" <hugo at beauzee.fr> a écrit :
>While I'm not sure if psz_location being NULL when using
>vlc_stream_NewURL is by design, I can't find logic relying on it.
>---
> src/input/access.c        | 3 +++
> src/input/stream_filter.c | 4 ++++
> 2 files changed, 7 insertions(+)
>
>diff --git a/src/input/access.c b/src/input/access.c
>index b4f1531ff6..1ddf82ec0c 100644
>--- a/src/input/access.c
>+++ b/src/input/access.c
>@@ -319,6 +319,9 @@ stream_t *stream_AccessNew(vlc_object_t *parent,
>input_thread_t *input,
>             vlc_stream_Delete(access);
>             return NULL;
>         }
>+        const char *p = strstr(s->psz_url, "://");
>+        assert(p != NULL);
>+        s->psz_location = p + 3;
> 
>         if (access->pf_block != NULL)
>             s->pf_block = AStreamReadBlock;
>diff --git a/src/input/stream_filter.c b/src/input/stream_filter.c
>index b18eefa4ad..3c9207d972 100644
>--- a/src/input/stream_filter.c
>+++ b/src/input/stream_filter.c
>@@ -69,6 +69,10 @@ stream_t *vlc_stream_FilterNew( stream_t *p_source,
> 
>         if( p_source->psz_filepath != NULL )
>             s->psz_filepath = strdup( p_source->psz_filepath );
>+
>+        const char *p = strstr(s->psz_url, "://");
>+        if( p != NULL )
>+            s->psz_location = p + 3;
>     }
>     s->s = p_source;
> 
>-- 
>2.20.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190220/b4327d4c/attachment.html>


More information about the vlc-devel mailing list