Commit b4e6c46e authored by Jean-Paul Saman's avatar Jean-Paul Saman

stream_out: keep caching value in the mux_sys_t struct iso of asking it every time.

parent 59c9e899
...@@ -156,6 +156,7 @@ struct sout_mux_t ...@@ -156,6 +156,7 @@ struct sout_mux_t
bool b_waiting_stream; bool b_waiting_stream;
/* we wait one second after first stream added */ /* we wait one second after first stream added */
mtime_t i_add_stream_start; mtime_t i_add_stream_start;
mtime_t i_caching;
}; };
enum sout_mux_query_e enum sout_mux_query_e
......
...@@ -432,6 +432,7 @@ sout_mux_t * sout_MuxNew( sout_instance_t *p_sout, char *psz_mux, ...@@ -432,6 +432,7 @@ sout_mux_t * sout_MuxNew( sout_instance_t *p_sout, char *psz_mux,
p_mux->b_add_stream_any_time = false; p_mux->b_add_stream_any_time = false;
p_mux->b_waiting_stream = true; p_mux->b_waiting_stream = true;
p_mux->i_add_stream_start = -1; p_mux->i_add_stream_start = -1;
p_mux->i_caching = var_GetInteger( p_mux->p_sout, "sout-mux-caching" ) * INT64_C(1000);
vlc_object_attach( p_mux, p_sout ); vlc_object_attach( p_mux, p_sout );
...@@ -592,13 +593,16 @@ void sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input, ...@@ -592,13 +593,16 @@ void sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input,
{ {
mtime_t current_date = mdate(); mtime_t current_date = mdate();
if ( current_date > p_buffer->i_dts ) if ( current_date > p_buffer->i_dts )
{
msg_Warn( p_mux, "late buffer for mux input (%"PRId64")", msg_Warn( p_mux, "late buffer for mux input (%"PRId64")",
current_date - p_buffer->i_dts ); current_date - p_buffer->i_dts );
p_mux->b_waiting_stream = false;
}
} }
if( p_mux->b_waiting_stream ) if( p_mux->b_waiting_stream )
{ {
const int64_t i_caching = var_GetInteger( p_mux->p_sout, "sout-mux-caching" ) * INT64_C(1000); const int64_t i_caching = p_mux->i_caching;
if( p_mux->i_add_stream_start < 0 ) if( p_mux->i_add_stream_start < 0 )
p_mux->i_add_stream_start = p_buffer->i_dts; p_mux->i_add_stream_start = p_buffer->i_dts;
......
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