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

Hugo Beauzée-Luyssen git at videolan.org
Thu Apr 6 17:49:08 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Apr  6 16:55:48 2017 +0200| [7eadbd995d3dc9e29a2510eb2ae0b76aecc4c280] | committer: Hugo Beauzée-Luyssen

access_demux: Remove unneeded checks for psz_access nullity

It will never be NULL for access & access_demux, but can be
for demux_filter. However, these modules aren't demux_filter

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

 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 6f42475..76eee0e 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 4bddd85..5fbbe02 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 8fc2972..83208fb 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" );



More information about the vlc-commits mailing list