fix --no-stats in a few cases (there are more remaining)

parent 502d2180
...@@ -1022,7 +1022,7 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block ) ...@@ -1022,7 +1022,7 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block )
input_thread_t *p_input = p_sys->p_input; input_thread_t *p_input = p_sys->p_input;
es_out_pgrm_t *p_pgrm = es->p_pgrm; es_out_pgrm_t *p_pgrm = es->p_pgrm;
int64_t i_delay; int64_t i_delay;
int i_total; int i_total=0;
if( es->fmt.i_cat == AUDIO_ES ) if( es->fmt.i_cat == AUDIO_ES )
i_delay = p_sys->i_audio_delay; i_delay = p_sys->i_audio_delay;
...@@ -1031,10 +1031,13 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block ) ...@@ -1031,10 +1031,13 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block )
else else
i_delay = 0; i_delay = 0;
stats_UpdateInteger( p_input, "demux_read", p_block->i_buffer ); if( p_input->p_libvlc->b_stats )
stats_GetInteger( p_input, p_input->i_object_id, "demux_read", {
&i_total ); stats_UpdateInteger( p_input, "demux_read", p_block->i_buffer );
stats_UpdateFloat( p_input , "demux_bitrate", (float)i_total ); stats_GetInteger( p_input, p_input->i_object_id, "demux_read",
&i_total );
stats_UpdateFloat( p_input , "demux_bitrate", (float)i_total );
}
/* Mark preroll blocks */ /* Mark preroll blocks */
if( es->i_preroll_end >= 0 ) if( es->i_preroll_end >= 0 )
......
...@@ -1635,7 +1635,7 @@ static block_t *AReadBlock( stream_t *s, vlc_bool_t *pb_eof ) ...@@ -1635,7 +1635,7 @@ static block_t *AReadBlock( stream_t *s, vlc_bool_t *pb_eof )
{ {
p_block = p_access->pf_block( p_access ); p_block = p_access->pf_block( p_access );
if( pb_eof ) *pb_eof = p_access->info.b_eof; if( pb_eof ) *pb_eof = p_access->info.b_eof;
if( p_block ) if( p_block && p_access->p_libvlc->b_stats )
{ {
stats_UpdateInteger( s->p_parent->p_parent, "read_bytes", stats_UpdateInteger( s->p_parent->p_parent, "read_bytes",
p_block->i_buffer ); p_block->i_buffer );
......
...@@ -367,17 +367,23 @@ int sout_AccessOutRead( sout_access_out_t *p_access, block_t *p_buffer ) ...@@ -367,17 +367,23 @@ int sout_AccessOutRead( sout_access_out_t *p_access, block_t *p_buffer )
int sout_AccessOutWrite( sout_access_out_t *p_access, block_t *p_buffer ) int sout_AccessOutWrite( sout_access_out_t *p_access, block_t *p_buffer )
{ {
int i_total; int i_total;
/* Access_out -> sout_instance -> input_thread_t */ if( p_access->p_libvlc->b_stats )
input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_access,
VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input )
{ {
stats_UpdateInteger( p_input, "sout_sent_packets", 1 ); /* Access_out -> sout_instance -> input_thread_t */
stats_UpdateInteger( p_input, "sout_sent_bytes", p_buffer->i_buffer ); input_thread_t *p_input =
stats_GetInteger( p_input, p_access->p_parent->p_parent->i_object_id, (input_thread_t *)vlc_object_find( p_access, VLC_OBJECT_INPUT,
"sout_sent_bytes", &i_total ); FIND_PARENT );
stats_UpdateFloat( p_input, "sout_send_bitrate", (float)i_total ); if( p_input )
vlc_object_release( p_input ); {
stats_UpdateInteger( p_input, "sout_sent_packets", 1 );
stats_UpdateInteger( p_input, "sout_sent_bytes",
p_buffer->i_buffer );
stats_GetInteger( p_input,
p_access->p_parent->p_parent->i_object_id,
"sout_sent_bytes", &i_total );
stats_UpdateFloat( p_input, "sout_send_bitrate", (float)i_total );
vlc_object_release( p_input );
}
} }
return p_access->pf_write( p_access, p_buffer ); return p_access->pf_write( p_access, p_buffer );
} }
......
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