[vlc-commits] demux: process filters in usual order

Rémi Denis-Courmont git at videolan.org
Sun Jul 30 20:27:02 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 30 21:26:00 2017 +0300| [5a55754efa010c585342e1bb28dace49422531ee] | committer: Rémi Denis-Courmont

demux: process filters in usual order

There are no obvious reasons to process the demux filter chain in
reverse order. All other chains are processed from upstream to
downstream.

As there was typically only zero or one filter(s), it won´t matter
much for the time being.

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

 src/input/demux.c | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/src/input/demux.c b/src/input/demux.c
index aafa0d62ad..93a65e6b92 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -610,9 +610,6 @@ demux_t *demux_FilterChainNew( demux_t *p_demux, const char *psz_chain )
     if(!psz_parser)
         return NULL;
 
-    vlc_array_t name;
-    vlc_array_init(&name);
-
     /* parse chain */
     while(psz_parser)
     {
@@ -622,22 +619,13 @@ demux_t *demux_FilterChainNew( demux_t *p_demux, const char *psz_chain )
         free( psz_parser );
         psz_parser = psz_rest_chain;
 
-        vlc_array_append(&name, psz_name);
-        config_ChainDestroy(p_cfg);
-    }
-
-    size_t i = vlc_array_count(&name);
-    while(i--)
-    {
-        char *p_name = vlc_array_item_at_index(&name, i);
-        demux_t *p_next = demux_FilterNew( p_demux, p_name );
-
-        free( p_name );
+        demux_t *filter = demux_FilterNew(p_demux, psz_name);
+        if (filter != NULL)
+            p_demux = filter;
 
-        p_demux = p_next;
+        free(psz_name);
+        config_ChainDestroy(p_cfg);
     }
 
-    vlc_array_clear(&name);
-
     return p_demux;
 }



More information about the vlc-commits mailing list