[vlc-commits] demux: assume non-NULL stream in demux_New()

Rémi Denis-Courmont git at videolan.org
Sun Mar 25 16:42:41 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Mar 24 11:54:57 2018 +0200| [3ca8d35e348c8d90ebb031e4558044f12e3a2010] | committer: Rémi Denis-Courmont

demux: assume non-NULL stream in demux_New()

The case of NULL stream has been unused for a while.

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

 include/vlc_demux.h | 1 -
 src/input/demux.c   | 9 ++-------
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index 1b547d2774..c0155fe54f 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -276,7 +276,6 @@ enum demux_query_e
  * Main Demux
  *************************************************************************/
 
-/* stream_t *s could be null and then it mean a access+demux in one */
 VLC_API demux_t *demux_New( vlc_object_t *p_obj, const char *psz_name,
                             const char *psz_path, stream_t *s, es_out_t *out );
 
diff --git a/src/input/demux.c b/src/input/demux.c
index d78103ee31..a8e049bdea 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -138,16 +138,11 @@ static const char* DemuxNameFromExtension( char const* ext,
     return result ? result->name : NULL;
 }
 
-/*****************************************************************************
- * demux_New:
- *  if s is NULL then load a access_demux
- *****************************************************************************/
 demux_t *demux_New( vlc_object_t *p_obj, const char *psz_name,
                     const char *psz_location, stream_t *s, es_out_t *out )
 {
-    return demux_NewAdvanced( p_obj, NULL,
-                              (s == NULL) ? psz_name : "",
-                              (s != NULL) ? psz_name : "",
+    assert(s != NULL );
+    return demux_NewAdvanced( p_obj, NULL, "", psz_name,
                               psz_location, s, out, false );
 }
 



More information about the vlc-commits mailing list