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

Hugo Beauzée-Luyssen hugo at beauzee.fr
Tue Feb 19 11:09:10 CET 2019


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



More information about the vlc-devel mailing list