[vlc-commits] stream_filter: separate hard-coded "record" stream filter insertion

Rémi Denis-Courmont git at videolan.org
Tue Aug 25 20:33:15 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Aug 25 20:46:33 2015 +0300| [70a513b938daaea977374003bb6ef0f167b286af] | committer: Rémi Denis-Courmont

stream_filter: separate hard-coded "record" stream filter insertion

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

 src/input/input.c         |    6 ++++--
 src/input/stream.h        |    9 +++------
 src/input/stream_filter.c |   16 +++++-----------
 3 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 535f06e..8092f3b 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2313,10 +2313,12 @@ static int InputSourceInit( input_thread_t *p_input,
 
         char *psz_stream_filter = var_GetNonEmptyString( p_input,
                                                          "stream-filter" );
-        p_stream = stream_FilterChainNew( p_stream, psz_stream_filter,
-                               var_GetBool( p_input, "input-record-native" ) );
+        p_stream = stream_FilterChainNew( p_stream, psz_stream_filter );
         free( psz_stream_filter );
 
+        if( var_GetBool( p_input, "input-record-native" ) )
+            p_stream = stream_FilterChainNew( p_stream, "record" );
+
         if( !p_input->b_preparsing )
         {
             bool b;
diff --git a/src/input/stream.h b/src/input/stream.h
index 6973cfe..6602186 100644
--- a/src/input/stream.h
+++ b/src/input/stream.h
@@ -55,14 +55,11 @@ stream_t *stream_FilterNew( stream_t *p_source,
 stream_t *stream_FilterAutoNew( stream_t *source ) VLC_USED;
 
 /**
- * This function creates a chain of filters:
- * - optional user filters (configured by psz_chain) are inserted.
- * - an optional record filter is inserted if b_record is true.
+ * This function creates a chain of filters according to the colon-separated
+ * list.
  *
  * You must release the returned value using stream_Delete unless it is used as a
  * source to another filter.
  */
-stream_t *stream_FilterChainNew( stream_t *p_source,
-                                 const char *psz_chain,
-                                 bool b_record );
+stream_t *stream_FilterChainNew( stream_t *p_source, const char *psz_chain );
 #endif
diff --git a/src/input/stream_filter.c b/src/input/stream_filter.c
index ef5b3d4..6013713 100644
--- a/src/input/stream_filter.c
+++ b/src/input/stream_filter.c
@@ -88,12 +88,13 @@ stream_t *stream_FilterAutoNew( stream_t *p_source )
     return p_source;
 }
 
-stream_t *stream_FilterChainNew( stream_t *p_source,
-                                 const char *psz_chain,
-                                 bool b_record )
+stream_t *stream_FilterChainNew( stream_t *p_source, const char *psz_chain )
 {
+    if( psz_chain == NULL )
+        return p_source;
+
     /* Add user stream filter */
-    char *psz_tmp = psz_chain ? strdup( psz_chain ) : NULL;
+    char *psz_tmp = strdup( psz_chain );
     char *psz = psz_tmp;
     while( psz && *psz )
     {
@@ -113,13 +114,6 @@ stream_t *stream_FilterChainNew( stream_t *p_source,
     }
     free( psz_tmp );
 
-    /* Add record filter if useful */
-    if( b_record )
-    {
-        stream_t *p_filter = stream_FilterNew( p_source, "record" );
-        if( p_filter )
-            p_source = p_filter;
-    }
     return p_source;
 }
 



More information about the vlc-commits mailing list