[vlc-commits] sout: we don't modify the chain string

Steve Lhomme git at videolan.org
Thu Nov 26 18:13:53 CET 2015


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Thu Oct 29 16:05:38 2015 +0100| [d03be6c00b0df426ed581461a1a5ea00c1c78ec0] | committer: Jean-Baptiste Kempf

sout: we don't modify the chain string

without the const passing a std::string.c_str() in C++ fails

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 include/vlc_sout.h                |    2 +-
 src/missing.c                     |    2 +-
 src/stream_output/stream_output.c |    6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/vlc_sout.h b/include/vlc_sout.h
index c2470f2..aeae53a 100644
--- a/include/vlc_sout.h
+++ b/include/vlc_sout.h
@@ -212,7 +212,7 @@ struct sout_stream_t
 
 VLC_API void sout_StreamChainDelete(sout_stream_t *p_first, sout_stream_t *p_last );
 VLC_API sout_stream_t *sout_StreamChainNew(sout_instance_t *p_sout,
-        char *psz_chain, sout_stream_t *p_next, sout_stream_t **p_last) VLC_USED;
+        const char *psz_chain, sout_stream_t *p_next, sout_stream_t **p_last) VLC_USED;
 
 static inline sout_stream_id_sys_t *sout_StreamIdAdd( sout_stream_t *s,
                                                       const es_format_t *fmt )
diff --git a/src/missing.c b/src/missing.c
index a4897ee..24218f3 100644
--- a/src/missing.c
+++ b/src/missing.c
@@ -320,7 +320,7 @@ void sout_StreamChainDelete (sout_stream_t *p_first, sout_stream_t *p_last)
     vlc_assert_unreachable ();
 }
 
-sout_stream_t *sout_StreamChainNew (sout_instance_t *p_sout, char *psz_chain,
+sout_stream_t *sout_StreamChainNew (sout_instance_t *p_sout, const char *psz_chain,
                                     sout_stream_t *p_next,
                                     sout_stream_t **pp_last)
 {
diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
index 66bca45..113fce2 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -810,7 +810,7 @@ static sout_stream_t *sout_StreamNew( sout_instance_t *p_sout, char *psz_name,
  *
  *  Returns a pointer to the first module.
  */
-sout_stream_t *sout_StreamChainNew(sout_instance_t *p_sout, char *psz_chain,
+sout_stream_t *sout_StreamChainNew(sout_instance_t *p_sout, const char *psz_chain,
                                 sout_stream_t *p_next, sout_stream_t **pp_last)
 {
     if(!psz_chain || !*psz_chain)
@@ -832,9 +832,9 @@ sout_stream_t *sout_StreamChainNew(sout_instance_t *p_sout, char *psz_chain,
     {
         config_chain_t *p_cfg;
         char *psz_name;
-        psz_chain = config_ChainCreate( &psz_name, &p_cfg, psz_parser );
+        char *psz_rest_chain = config_ChainCreate( &psz_name, &p_cfg, psz_parser );
         free( psz_parser );
-        psz_parser = psz_chain;
+        psz_parser = psz_rest_chain;
 
         vlc_array_append(&cfg, p_cfg);
         vlc_array_append(&name, psz_name);



More information about the vlc-commits mailing list