Commit 862771a8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

mux: constify stream format

parent 49364d3a
......@@ -146,15 +146,15 @@ enum sout_mux_query_e
struct sout_input_t
{
es_format_t *p_fmt;
block_fifo_t *p_fifo;
void *p_sys;
const es_format_t *p_fmt;
block_fifo_t *p_fifo;
void *p_sys;
es_format_t fmt;
};
VLC_API sout_mux_t * sout_MuxNew( sout_instance_t*, const char *, sout_access_out_t * ) VLC_USED;
VLC_API sout_input_t * sout_MuxAddStream( sout_mux_t *, es_format_t * ) VLC_USED;
VLC_API sout_input_t *sout_MuxAddStream( sout_mux_t *, const es_format_t * ) VLC_USED;
VLC_API void sout_MuxDeleteStream( sout_mux_t *, sout_input_t * );
VLC_API void sout_MuxDelete( sout_mux_t * );
VLC_API int sout_MuxSendBuffer( sout_mux_t *, sout_input_t *, block_t * );
......
......@@ -381,8 +381,9 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
!p_input->p_fmt->video.i_frame_rate_base )
{
msg_Warn( p_mux, "Missing frame rate, assuming 25fps" );
p_input->p_fmt->video.i_frame_rate = 25;
p_input->p_fmt->video.i_frame_rate_base = 1;
assert(p_input->p_fmt == &p_input->fmt);
p_input->fmt.video.i_frame_rate = 25;
p_input->fmt.video.i_frame_rate_base = 1;
}
switch( p_stream->i_fourcc )
......
......@@ -433,7 +433,7 @@ void sout_MuxDelete( sout_mux_t *p_mux )
/*****************************************************************************
* sout_MuxAddStream:
*****************************************************************************/
sout_input_t *sout_MuxAddStream( sout_mux_t *p_mux, es_format_t *p_fmt )
sout_input_t *sout_MuxAddStream( sout_mux_t *p_mux, const es_format_t *p_fmt )
{
sout_input_t *p_input;
......@@ -450,7 +450,11 @@ sout_input_t *sout_MuxAddStream( sout_mux_t *p_mux, es_format_t *p_fmt )
p_input = malloc( sizeof( sout_input_t ) );
if( !p_input )
return NULL;
p_input->p_fmt = p_fmt;
// FIXME: remove either fmt or p_fmt...
es_format_Copy( &p_input->fmt, p_fmt );
p_input->p_fmt = &p_input->fmt;
p_input->p_fifo = block_FifoNew();
p_input->p_sys = NULL;
......@@ -500,6 +504,7 @@ void sout_MuxDeleteStream( sout_mux_t *p_mux, sout_input_t *p_input )
}
block_FifoRelease( p_input->p_fifo );
es_format_Clean( &p_input->fmt );
free( p_input );
}
}
......
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