Commit 1f5a8130 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Const as usual

parent fad28488
...@@ -110,8 +110,8 @@ struct access_t ...@@ -110,8 +110,8 @@ struct access_t
}; };
#define access2_New( a, b, c, d, e ) __access2_New(VLC_OBJECT(a), b, c, d, e ) #define access2_New( a, b, c, d, e ) __access2_New(VLC_OBJECT(a), b, c, d, e )
VLC_EXPORT( access_t *, __access2_New, ( vlc_object_t *p_obj, char *psz_access, char *psz_demux, char *psz_path, vlc_bool_t b_quick ) ); VLC_EXPORT( access_t *, __access2_New, ( vlc_object_t *p_obj, const char *psz_access, const char *psz_demux, const char *psz_path, vlc_bool_t b_quick ) );
VLC_EXPORT( access_t *, access2_FilterNew, ( access_t *p_source, char *psz_access_filter ) ); VLC_EXPORT( access_t *, access2_FilterNew, ( access_t *p_source, const char *psz_access_filter ) );
VLC_EXPORT( void, access2_Delete, ( access_t * ) ); VLC_EXPORT( void, access2_Delete, ( access_t * ) );
static inline int access2_vaControl( access_t *p_access, int i_query, va_list args ) static inline int access2_vaControl( access_t *p_access, int i_query, va_list args )
......
...@@ -159,8 +159,8 @@ struct module_symbols_t ...@@ -159,8 +159,8 @@ struct module_symbols_t
void * (*vout_RequestWindow_inner) (vout_thread_t *, int *, int *, unsigned int *, unsigned int *); void * (*vout_RequestWindow_inner) (vout_thread_t *, int *, int *, unsigned int *, unsigned int *);
void (*vout_ReleaseWindow_inner) (vout_thread_t *, void *); void (*vout_ReleaseWindow_inner) (vout_thread_t *, void *);
int (*vout_ControlWindow_inner) (vout_thread_t *, void *, int, va_list); int (*vout_ControlWindow_inner) (vout_thread_t *, void *, int, va_list);
access_t * (*__access2_New_inner) (vlc_object_t *p_obj, char *psz_access, char *psz_demux, char *psz_path, vlc_bool_t b_quick); access_t * (*__access2_New_inner) (vlc_object_t *p_obj, const char *psz_access, const char *psz_demux, const char *psz_path, vlc_bool_t b_quick);
access_t * (*access2_FilterNew_inner) (access_t *p_source, char *psz_access_filter); access_t * (*access2_FilterNew_inner) (access_t *p_source, const char *psz_access_filter);
void (*access2_Delete_inner) (access_t *); void (*access2_Delete_inner) (access_t *);
block_t * (*__block_New_inner) (vlc_object_t *, int); block_t * (*__block_New_inner) (vlc_object_t *, int);
block_t * (*block_Realloc_inner) (block_t *, int i_pre, int i_body); block_t * (*block_Realloc_inner) (block_t *, int i_pre, int i_body);
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
/***************************************************************************** /*****************************************************************************
* access2_InternalNew: * access2_InternalNew:
*****************************************************************************/ *****************************************************************************/
static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access, static access_t *access2_InternalNew( vlc_object_t *p_obj, const char *psz_access,
char *psz_demux, char *psz_path, const char *psz_demux, const char *psz_path,
access_t *p_source, vlc_bool_t b_quick ) access_t *p_source, vlc_bool_t b_quick )
{ {
access_t *p_access = vlc_object_create( p_obj, VLC_OBJECT_ACCESS ); access_t *p_access = vlc_object_create( p_obj, VLC_OBJECT_ACCESS );
...@@ -108,8 +108,8 @@ static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access, ...@@ -108,8 +108,8 @@ static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access,
/***************************************************************************** /*****************************************************************************
* access2_New: * access2_New:
*****************************************************************************/ *****************************************************************************/
access_t *__access2_New( vlc_object_t *p_obj, char *psz_access, access_t *__access2_New( vlc_object_t *p_obj, const char *psz_access,
char *psz_demux, char *psz_path, vlc_bool_t b_quick ) const char *psz_demux, const char *psz_path, vlc_bool_t b_quick )
{ {
return access2_InternalNew( p_obj, psz_access, psz_demux, return access2_InternalNew( p_obj, psz_access, psz_demux,
psz_path, NULL, b_quick ); psz_path, NULL, b_quick );
...@@ -118,7 +118,7 @@ access_t *__access2_New( vlc_object_t *p_obj, char *psz_access, ...@@ -118,7 +118,7 @@ access_t *__access2_New( vlc_object_t *p_obj, char *psz_access,
/***************************************************************************** /*****************************************************************************
* access2_FilterNew: * access2_FilterNew:
*****************************************************************************/ *****************************************************************************/
access_t *access2_FilterNew( access_t *p_source, char *psz_access_filter ) access_t *access2_FilterNew( access_t *p_source, const char *psz_access_filter )
{ {
return access2_InternalNew( VLC_OBJECT(p_source), psz_access_filter, return access2_InternalNew( VLC_OBJECT(p_source), psz_access_filter,
NULL, NULL, p_source, VLC_FALSE ); NULL, NULL, p_source, VLC_FALSE );
......
...@@ -74,7 +74,7 @@ static void MRLSections( input_thread_t *, char *, int *, int *, int *, int *); ...@@ -74,7 +74,7 @@ static void MRLSections( input_thread_t *, char *, int *, int *, int *, int *);
static input_source_t *InputSourceNew( input_thread_t *); static input_source_t *InputSourceNew( input_thread_t *);
static int InputSourceInit( input_thread_t *, input_source_t *, static int InputSourceInit( input_thread_t *, input_source_t *,
char *, const char *psz_forced_demux ); const char *, const char *psz_forced_demux );
static void InputSourceClean( input_thread_t *, input_source_t * ); static void InputSourceClean( input_thread_t *, input_source_t * );
static void SlaveDemux( input_thread_t *p_input ); static void SlaveDemux( input_thread_t *p_input );
...@@ -1921,17 +1921,19 @@ static input_source_t *InputSourceNew( input_thread_t *p_input ) ...@@ -1921,17 +1921,19 @@ static input_source_t *InputSourceNew( input_thread_t *p_input )
* InputSourceInit: * InputSourceInit:
*****************************************************************************/ *****************************************************************************/
static int InputSourceInit( input_thread_t *p_input, static int InputSourceInit( input_thread_t *p_input,
input_source_t *in, char *psz_mrl, input_source_t *in, const char *psz_mrl,
const char *psz_forced_demux ) const char *psz_forced_demux )
{ {
char *psz_dup = strdup( psz_mrl ); char psz_dup[strlen (psz_mrl) + 1];
char *psz_access; const char *psz_access;
char *psz_demux; const char *psz_demux;
char *psz_path; char *psz_path;
char *psz_tmp; char *psz_tmp;
char *psz; char *psz;
vlc_value_t val; vlc_value_t val;
strcpy (psz_dup, psz_mrl);
if( !in ) return VLC_EGENERIC; if( !in ) return VLC_EGENERIC;
if( !p_input ) return VLC_EGENERIC; if( !p_input ) return VLC_EGENERIC;
...@@ -1986,7 +1988,7 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -1986,7 +1988,7 @@ static int InputSourceInit( input_thread_t *p_input,
} }
else else
{ {
psz_path = psz_mrl; psz_path = psz_dup;
msg_Dbg( p_input, "trying to pre-parse %s", psz_path ); msg_Dbg( p_input, "trying to pre-parse %s", psz_path );
psz_demux = ""; psz_demux = "";
psz_access = "file"; psz_access = "file";
...@@ -2048,8 +2050,7 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -2048,8 +2050,7 @@ static int InputSourceInit( input_thread_t *p_input,
if( in->p_access == NULL && if( in->p_access == NULL &&
*psz_access == '\0' && ( *psz_demux || *psz_path ) ) *psz_access == '\0' && ( *psz_demux || *psz_path ) )
{ {
if( psz_dup ) free( psz_dup ); strcpy (psz_dup, psz_mrl);
psz_dup = strdup( psz_mrl );
psz_access = ""; psz_access = "";
if( psz_forced_demux && *psz_forced_demux ) if( psz_forced_demux && *psz_forced_demux )
{ {
...@@ -2170,7 +2171,6 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -2170,7 +2171,6 @@ static int InputSourceInit( input_thread_t *p_input,
if( var_GetInteger( p_input, "clock-synchro" ) != -1 ) if( var_GetInteger( p_input, "clock-synchro" ) != -1 )
in->b_can_pace_control = !var_GetInteger( p_input, "clock-synchro" ); in->b_can_pace_control = !var_GetInteger( p_input, "clock-synchro" );
if( psz_dup ) free( psz_dup );
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
...@@ -2184,7 +2184,6 @@ error: ...@@ -2184,7 +2184,6 @@ error:
if( in->p_access ) if( in->p_access )
access2_Delete( in->p_access ); access2_Delete( in->p_access );
if( psz_dup ) free( psz_dup );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -2326,11 +2325,11 @@ static void InputMetaUser( input_thread_t *p_input ) ...@@ -2326,11 +2325,11 @@ static void InputMetaUser( input_thread_t *p_input )
*****************************************************************************/ *****************************************************************************/
void MRLSplit( vlc_object_t *p_input, char *psz_dup, void MRLSplit( vlc_object_t *p_input, char *psz_dup,
const char **ppsz_access, const char **ppsz_demux, const char **ppsz_access, const char **ppsz_demux,
const char **ppsz_path ) char **ppsz_path )
{ {
char *psz_access = NULL; const char *psz_access = "";
char *psz_demux = NULL; const char *psz_demux = "";
char *psz_path = NULL; char *psz_path;
char *psz, *psz_check; char *psz, *psz_check;
psz = strchr( psz_dup, ':' ); psz = strchr( psz_dup, ':' );
...@@ -2369,14 +2368,9 @@ void MRLSplit( vlc_object_t *p_input, char *psz_dup, ...@@ -2369,14 +2368,9 @@ void MRLSplit( vlc_object_t *p_input, char *psz_dup,
psz_path = psz_dup; psz_path = psz_dup;
} }
if( !psz_access ) *ppsz_access = ""; *ppsz_access = psz_access;
else *ppsz_access = psz_access; *ppsz_demux = psz_demux;
*ppsz_path = psz_path;
if( !psz_demux ) *ppsz_demux = "";
else *ppsz_demux = psz_demux;
if( !psz_path ) *ppsz_path = "";
else *ppsz_path = psz_path;
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -154,7 +154,7 @@ mtime_t input_ClockGetTS( input_thread_t *, input_clock_t *, mtime_t ); ...@@ -154,7 +154,7 @@ mtime_t input_ClockGetTS( input_thread_t *, input_clock_t *, mtime_t );
char **subtitles_Detect( input_thread_t *, char* path, char *fname ); char **subtitles_Detect( input_thread_t *, char* path, char *fname );
int subtitles_Filter( const char *); int subtitles_Filter( const char *);
void MRLSplit( vlc_object_t *, char *, const char **, const char **, const char ** ); void MRLSplit( vlc_object_t *, char *, const char **, const char **, char ** );
static inline void input_ChangeState( input_thread_t *p_input, int state ) static inline void input_ChangeState( input_thread_t *p_input, int state )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment