Commit f1d4df64 authored by Laurent Aimar's avatar Laurent Aimar

Constify es_out_Add es_format_t* argument.

parent a8498883
...@@ -100,7 +100,7 @@ enum es_out_query_e ...@@ -100,7 +100,7 @@ enum es_out_query_e
struct es_out_t struct es_out_t
{ {
es_out_id_t *(*pf_add) ( es_out_t *, es_format_t * ); es_out_id_t *(*pf_add) ( es_out_t *, const es_format_t * );
int (*pf_send) ( es_out_t *, es_out_id_t *, block_t * ); int (*pf_send) ( es_out_t *, es_out_id_t *, block_t * );
void (*pf_del) ( es_out_t *, es_out_id_t * ); void (*pf_del) ( es_out_t *, es_out_id_t * );
int (*pf_control)( es_out_t *, int i_query, va_list ); int (*pf_control)( es_out_t *, int i_query, va_list );
...@@ -112,7 +112,7 @@ struct es_out_t ...@@ -112,7 +112,7 @@ struct es_out_t
}; };
LIBVLC_USED LIBVLC_USED
static inline es_out_id_t * es_out_Add( es_out_t *out, es_format_t *fmt ) static inline es_out_id_t * es_out_Add( es_out_t *out, const es_format_t *fmt )
{ {
return out->pf_add( out, fmt ); return out->pf_add( out, fmt );
} }
......
...@@ -157,7 +157,7 @@ struct es_out_sys_t ...@@ -157,7 +157,7 @@ struct es_out_sys_t
sout_instance_t *p_sout_record; sout_instance_t *p_sout_record;
}; };
static es_out_id_t *EsOutAdd ( es_out_t *, es_format_t * ); static es_out_id_t *EsOutAdd ( es_out_t *, const es_format_t * );
static int EsOutSend ( es_out_t *, es_out_id_t *, block_t * ); static int EsOutSend ( es_out_t *, es_out_id_t *, block_t * );
static void EsOutDel ( es_out_t *, es_out_id_t * ); static void EsOutDel ( es_out_t *, es_out_id_t * );
static int EsOutControl( es_out_t *, int i_query, va_list ); static int EsOutControl( es_out_t *, int i_query, va_list );
...@@ -1279,7 +1279,7 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, vlc_epg_t *p_epg ) ...@@ -1279,7 +1279,7 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, vlc_epg_t *p_epg )
/* EsOutAdd: /* EsOutAdd:
* Add an es_out * Add an es_out
*/ */
static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt ) static es_out_id_t *EsOutAdd( es_out_t *out, const es_format_t *fmt )
{ {
es_out_sys_t *p_sys = out->p_sys; es_out_sys_t *p_sys = out->p_sys;
input_thread_t *p_input = p_sys->p_input; input_thread_t *p_input = p_sys->p_input;
...@@ -1318,13 +1318,13 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt ) ...@@ -1318,13 +1318,13 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
p_pgrm->i_es++; p_pgrm->i_es++;
/* Set up ES */ /* Set up ES */
if( fmt->i_id < 0 )
fmt->i_id = out->p_sys->i_id;
es->i_id = fmt->i_id;
es->p_pgrm = p_pgrm; es->p_pgrm = p_pgrm;
es_format_Copy( &es->fmt, fmt ); es_format_Copy( &es->fmt, fmt );
if( es->fmt.i_id < 0 )
es->fmt.i_id = out->p_sys->i_id;
es->i_id = fmt->i_id;
switch( fmt->i_cat ) switch( es->fmt.i_cat )
{ {
case AUDIO_ES: case AUDIO_ES:
{ {
...@@ -1355,7 +1355,7 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt ) ...@@ -1355,7 +1355,7 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
case VIDEO_ES: case VIDEO_ES:
es->i_channel = p_sys->i_video; es->i_channel = p_sys->i_video;
if( fmt->video.i_frame_rate && fmt->video.i_frame_rate_base ) if( es->fmt.video.i_frame_rate && es->fmt.video.i_frame_rate_base )
vlc_ureduce( &es->fmt.video.i_frame_rate, vlc_ureduce( &es->fmt.video.i_frame_rate,
&es->fmt.video.i_frame_rate_base, &es->fmt.video.i_frame_rate_base,
fmt->video.i_frame_rate, fmt->video.i_frame_rate,
...@@ -1370,8 +1370,8 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt ) ...@@ -1370,8 +1370,8 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
es->i_channel = 0; es->i_channel = 0;
break; break;
} }
es->psz_language = LanguageGetName( fmt->psz_language ); /* remember so we only need to do it once */ es->psz_language = LanguageGetName( es->fmt.psz_language ); /* remember so we only need to do it once */
es->psz_language_code = LanguageGetCode( fmt->psz_language ); es->psz_language_code = LanguageGetCode( es->fmt.psz_language );
es->p_dec = NULL; es->p_dec = NULL;
es->p_dec_record = NULL; es->p_dec_record = NULL;
for( i = 0; i < 4; i++ ) for( i = 0; i < 4; i++ )
...@@ -1387,7 +1387,7 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt ) ...@@ -1387,7 +1387,7 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
TAB_APPEND( out->p_sys->i_es, out->p_sys->es, es ); TAB_APPEND( out->p_sys->i_es, out->p_sys->es, es );
p_sys->i_id++; /* always incremented */ p_sys->i_id++; /* always incremented */
switch( fmt->i_cat ) switch( es->fmt.i_cat )
{ {
case AUDIO_ES: case AUDIO_ES:
p_sys->i_audio++; p_sys->i_audio++;
......
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