[vlc-commits] demux: rename psz_demux to psz_name (refs #18504)

Rémi Denis-Courmont git at videolan.org
Sat Dec 2 22:26:51 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Dec  2 23:05:58 2017 +0200| [f7ddeb535a9d674d3ef3786efa796ffffee8fb5b] | committer: Rémi Denis-Courmont

demux: rename psz_demux to psz_name (refs #18504)

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

 include/vlc_demux.h         |  4 ++--
 modules/access/dvdnav.c     |  3 +--
 modules/access/rtp/rtp.c    | 10 +++++-----
 modules/access/screen/xcb.c |  4 ++--
 modules/misc/stats.c        |  2 +-
 src/input/demux.c           | 18 +++++++++---------
 6 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index 375f997b96..0cf4255772 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -48,7 +48,7 @@ struct demux_t
     module_t    *p_module;
 
     /* eg informative but needed (we can have access+demux) */
-    char        *psz_demux;
+    char        *psz_name;
     char        *psz_url;
     const char  *psz_location;
     char        *psz_filepath;
@@ -412,7 +412,7 @@ static inline bool demux_IsContentType(demux_t *demux, const char *type)
 VLC_USED
 static inline bool demux_IsForced( demux_t *p_demux, const char *psz_name )
 {
-   if( !p_demux->psz_demux || strcmp( p_demux->psz_demux, psz_name ) )
+   if( p_demux->psz_name == NULL || strcmp( p_demux->psz_name, psz_name ) )
         return false;
     return true;
 }
diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index b7135fcd69..705e2f985d 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -455,8 +455,7 @@ static int DemuxOpen ( vlc_object_t *p_this )
     dvdnav_t *p_dvdnav = NULL;
     bool forced = false, b_seekable = false;
 
-    if( p_demux->psz_demux != NULL
-     && !strncmp(p_demux->psz_demux, "dvd", 3) )
+    if( p_demux->psz_name != NULL && !strncmp(p_demux->psz_name, "dvd", 3) )
         forced = true;
 
     /* StreamProbeDVD need FASTSEEK, but if dvd is forced, we don't probe thus
diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
index 771437dc32..48a2b4bc19 100644
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -162,16 +162,16 @@ static int Open (vlc_object_t *obj)
     demux_t *demux = (demux_t *)obj;
     int tp; /* transport protocol */
 
-    if (!strcasecmp(demux->psz_demux, "dccp"))
+    if (!strcasecmp(demux->psz_name, "dccp"))
         tp = IPPROTO_DCCP;
     else
-    if (!strcasecmp(demux->psz_demux, "rtptcp"))
+    if (!strcasecmp(demux->psz_name, "rtptcp"))
         tp = IPPROTO_TCP;
     else
-    if (!strcasecmp(demux->psz_demux, "rtp"))
+    if (!strcasecmp(demux->psz_name, "rtp"))
         tp = IPPROTO_UDP;
     else
-    if (!strcasecmp(demux->psz_demux, "udplite"))
+    if (!strcasecmp(demux->psz_name, "udplite"))
         tp = IPPROTO_UDPLITE;
     else
         return VLC_EGENERIC;
@@ -637,7 +637,7 @@ static void mpv_decode (demux_t *demux, void *data, block_t *block)
  */
 static void *ts_init (demux_t *demux)
 {
-    char const* name = demux->psz_demux;
+    char const* name = demux->psz_name;
 
     if (*name == '\0' || !strcasecmp(name, "any"))
         name = NULL;
diff --git a/modules/access/screen/xcb.c b/modules/access/screen/xcb.c
index 060d2c61c2..4833030c3b 100644
--- a/modules/access/screen/xcb.c
+++ b/modules/access/screen/xcb.c
@@ -161,7 +161,7 @@ static int Open (vlc_object_t *obj)
     p_sys->conn = conn;
 
    /* Find configured screen */
-    if (!strcasecmp(demux->psz_demux, "screen"))
+    if (!strcasecmp(demux->psz_name, "screen"))
     {
         const xcb_setup_t *setup = xcb_get_setup (conn);
         const xcb_screen_t *scr = NULL;
@@ -184,7 +184,7 @@ static int Open (vlc_object_t *obj)
     }
     else
     /* Determine capture window */
-    if (!strcasecmp(demux->psz_demux, "window"))
+    if (!strcasecmp(demux->psz_name, "window"))
     {
         char *end;
         unsigned long ul = strtoul (demux->psz_location, &end, 0);
diff --git a/modules/misc/stats.c b/modules/misc/stats.c
index 2a26c8b285..4d02a307d9 100644
--- a/modules/misc/stats.c
+++ b/modules/misc/stats.c
@@ -177,7 +177,7 @@ static int OpenDemux ( vlc_object_t *p_this )
     p_demux->p_sys = NULL;
 
     /* Only when selected */
-    if( *p_demux->psz_demux == '\0' )
+    if( *p_demux->psz_name == '\0' )
         return VLC_EGENERIC;
 
     msg_Dbg( p_demux, "Init Stat demux" );
diff --git a/src/input/demux.c b/src/input/demux.c
index 9c610aab62..f9f6924be5 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -220,8 +220,8 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
     size_t schemelen = strlen(psz_access);
 
     p_demux->p_input = p_parent_input;
-    p_demux->psz_demux = strdup( psz_demux );
-    if (unlikely(p_demux->psz_demux == NULL))
+    p_demux->psz_name = strdup( psz_demux );
+    if (unlikely(p_demux->psz_name == NULL))
         goto error;
 
     if (unlikely(asprintf(&p_demux->psz_url, "%s://%s", psz_access,
@@ -233,7 +233,7 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
 
     if( !b_preparsing )
         msg_Dbg( p_obj, "creating demux: access='%s' demux='%s' "
-                 "location='%s' file='%s'", psz_access, p_demux->psz_demux,
+                 "location='%s' file='%s'", psz_access, psz_demux,
                  p_demux->psz_location, p_demux->psz_filepath );
 
     p_demux->s              = s;
@@ -252,7 +252,7 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
     {
         const char *psz_module = NULL;
 
-        if( !strcmp( p_demux->psz_demux, "any" ) && p_demux->psz_filepath )
+        if( !strcmp( p_demux->psz_name, "any" ) && p_demux->psz_filepath )
         {
             char const* psz_ext = strrchr( p_demux->psz_filepath, '.' );
 
@@ -261,10 +261,10 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
         }
 
         if( psz_module == NULL )
-            psz_module = p_demux->psz_demux;
+            psz_module = p_demux->psz_name;
 
         p_demux->p_module = vlc_module_load(p_demux, "demux", psz_module,
-             !strcmp(psz_module, p_demux->psz_demux), demux_Probe, p_demux);
+             !strcmp(psz_module, p_demux->psz_name), demux_Probe, p_demux);
     }
     else
     {
@@ -281,7 +281,7 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
 
     return p_demux;
 error:
-    free( p_demux->psz_demux );
+    free( p_demux->psz_name );
     vlc_object_release( p_demux );
     return NULL;
 }
@@ -298,7 +298,7 @@ void demux_Delete( demux_t *p_demux )
     priv->destroy(p_demux);
     free( p_demux->psz_filepath );
     free( p_demux->psz_url );
-    free( p_demux->psz_demux );
+    free( p_demux->psz_name );
     vlc_object_release( p_demux );
 }
 
@@ -587,7 +587,7 @@ static demux_t *demux_FilterNew( demux_t *p_next, const char *p_name )
     p_demux->p_next       = p_next;
     p_demux->p_input      = NULL;
     p_demux->p_sys        = NULL;
-    p_demux->psz_demux    = NULL;
+    p_demux->psz_name     = NULL;
     p_demux->psz_url      = NULL;
     p_demux->psz_location = NULL;
     p_demux->psz_filepath = NULL;



More information about the vlc-commits mailing list