]> git.sesse.net Git - vlc/blobdiff - src/input/demux.c
Switch the few var_GetString remains to var_GetNonEmptyString
[vlc] / src / input / demux.c
index 62706566fc124e8ce03b805eca99a2974681d56e..712bfd2276ef87173b2c08acfd0da14ad32be87c 100644 (file)
@@ -21,7 +21,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include <stdlib.h>
 #include <vlc/vlc.h>
 
 #include "input_internal.h"
@@ -51,7 +50,9 @@ demux_t *__demux2_New( vlc_object_t *p_obj,
     if( *p_demux->psz_demux == '\0' )
     {
         free( p_demux->psz_demux );
-        p_demux->psz_demux = var_GetString( p_obj, "demux" );
+        p_demux->psz_demux = var_GetNonEmptyString( p_obj, "demux" );
+        if( p_demux->psz_demux == NULL )
+            p_demux->psz_demux = strdup( "" );
     }
 
     if( !b_quick )
@@ -297,7 +298,7 @@ typedef struct
 } d_stream_sys_t;
 
 static int DStreamRead   ( stream_t *, void *p_read, int i_read );
-static int DStreamPeek   ( stream_t *, uint8_t **pp_peek, int i_peek );
+static int DStreamPeek   ( stream_t *, const uint8_t **pp_peek, int i_peek );
 static int DStreamControl( stream_t *, int i_query, va_list );
 static int DStreamThread ( stream_t * );
 
@@ -312,7 +313,6 @@ stream_t *__stream_DemuxNew( vlc_object_t *p_obj, const char *psz_demux,
     if( psz_demux == NULL || *psz_demux == '\0' ) return NULL;
 
     s = vlc_stream_create( p_obj );
-    s->pf_block  = NULL;
     s->pf_read   = DStreamRead;
     s->pf_peek   = DStreamPeek;
     s->pf_control= DStreamControl;
@@ -419,7 +419,7 @@ static int DStreamRead( stream_t *s, void *p_read, int i_read )
     return i_out;
 }
 
-static int DStreamPeek( stream_t *s, uint8_t **pp_peek, int i_peek )
+static int DStreamPeek( stream_t *s, const uint8_t **pp_peek, int i_peek )
 {
     d_stream_sys_t *p_sys = (d_stream_sys_t*)s->p_sys;
     block_t **pp_block = &p_sys->p_block;
@@ -545,7 +545,7 @@ static int DStreamThread( stream_t *s )
  ****************************************************************************/
 static void SkipID3Tag( demux_t *p_demux )
 {
-    uint8_t *p_peek;
+    const uint8_t *p_peek;
     uint8_t version, revision;
     int i_size;
     int b_footer;