[vlc-devel] [PATCH] access_demux: Remove unneeded checks for psz_access nullity

Hugo Beauzée-Luyssen hugo at beauzee.fr
Thu Apr 6 17:06:10 CEST 2017


AFAICS, it will never be be NULL for access & access_demux, but can be
for demux_filter. However, those modules aren't demux_filter
---
 modules/access/bluray.c  | 2 +-
 modules/access/dvdnav.c  | 3 +--
 modules/access/dvdread.c | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 6f424753fe..76eee0ecd1 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -629,7 +629,7 @@ static int blurayOpen(vlc_object_t *object)
     forced = !strcasecmp(p_demux->psz_access, "bluray");
 
     if (p_demux->s) {
-        if (p_demux->psz_access == NULL || !strcasecmp(p_demux->psz_access, "file")) {
+        if (!strcasecmp(p_demux->psz_access, "file")) {
             /* use access_demux for local files */
             return VLC_EGENERIC;
         }
diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index 4bddd856d3..5fbbe0230d 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -344,8 +344,7 @@ static int AccessDemuxOpen ( vlc_object_t *p_this )
     int i_ret = VLC_EGENERIC;
     bool forced = false;
 
-    if( p_demux->psz_access != NULL
-     && !strncmp(p_demux->psz_access, "dvd", 3) )
+    if( !strncmp(p_demux->psz_access, "dvd", 3) )
         forced = true;
 
     if( !p_demux->psz_file || !*p_demux->psz_file )
diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index 8fc29721db..83208fb972 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -169,7 +169,7 @@ static int Open( vlc_object_t *p_this )
     if( !p_demux->psz_file || !*p_demux->psz_file )
     {
         /* Only when selected */
-        if( !p_demux->psz_access || !*p_demux->psz_access )
+        if( !*p_demux->psz_access )
             return VLC_EGENERIC;
 
         psz_file = var_InheritString( p_this, "dvd" );
-- 
2.11.0



More information about the vlc-devel mailing list