[vlc-commits] commit: stream_filter core: add procotol information to stream_t ( Jean-Paul Saman )

git at videolan.org git at videolan.org
Tue Nov 2 11:15:11 CET 2010


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Wed Oct 13 22:49:20 2010 +0200| [87a2d70001283537e8b2798bf43f657fbb4cf577] | committer: Jean-Paul Saman 

stream_filter core: add procotol information to stream_t

In addition to p_access->psz_location also add p_access->psz_access to the contructed
stream_t *. It will allow a stream_filter to determine the protocol used in case it was
constructed with an access input.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=87a2d70001283537e8b2798bf43f657fbb4cf577
---

 include/vlc_stream.h      |    1 +
 src/input/stream.c        |    4 +++-
 src/input/stream_filter.c |    2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/vlc_stream.h b/include/vlc_stream.h
index 1d49989..6ec7d70 100644
--- a/include/vlc_stream.h
+++ b/include/vlc_stream.h
@@ -57,6 +57,7 @@ struct stream_t
     /* Module properties for stream filter */
     module_t    *p_module;
 
+    char        *psz_access;
     /* Real or virtual path (it can only be changed during stream_t opening) */
     char        *psz_path;
 
diff --git a/src/input/stream.c b/src/input/stream.c
index f0a90dc..ebbdac3 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -237,6 +237,7 @@ void stream_CommonDelete( stream_t *s )
             vlc_iconv_close( s->p_text->conv );
         free( s->p_text );
     }
+    free( s->psz_access );
     free( s->psz_path );
     vlc_object_release( s );
 }
@@ -294,9 +295,10 @@ stream_t *stream_AccessNew( access_t *p_access, char **ppsz_list )
         return NULL;
 
     s->p_input = p_access->p_input;
+    s->psz_access = strdup( p_access->psz_access );
     s->psz_path = strdup( p_access->psz_location );
     s->p_sys = p_sys = malloc( sizeof( *p_sys ) );
-    if( !s->psz_path || !s->p_sys )
+    if( !s->psz_access || !s->psz_path || !s->p_sys )
     {
         stream_CommonDelete( s );
         return NULL;
diff --git a/src/input/stream_filter.c b/src/input/stream_filter.c
index 73255e5..951bdda 100644
--- a/src/input/stream_filter.c
+++ b/src/input/stream_filter.c
@@ -49,6 +49,7 @@ stream_t *stream_FilterNew( stream_t *p_source,
     s->p_input = p_source->p_input;
 
     /* */
+    s->psz_access = strdup( p_source->psz_access );
     s->psz_path = strdup( p_source->psz_path );
     if( !s->psz_path )
     {
@@ -129,4 +130,3 @@ static void StreamDelete( stream_t *s )
 
     stream_CommonDelete( s );
 }
-



More information about the vlc-commits mailing list