]> git.sesse.net Git - vlc/commitdiff
fix --no-stats in a few cases (there are more remaining)
authorSigmund Augdal Helberg <sigmunau@videolan.org>
Fri, 3 Feb 2006 14:07:41 +0000 (14:07 +0000)
committerSigmund Augdal Helberg <sigmunau@videolan.org>
Fri, 3 Feb 2006 14:07:41 +0000 (14:07 +0000)
src/input/es_out.c
src/input/stream.c
src/stream_output/stream_output.c

index c02a8711e982745432e85a1fb13491fa2b36af98..4525aeed583ac85a307f391c5eb3ea39f550d400 100644 (file)
@@ -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;
     es_out_pgrm_t *p_pgrm = es->p_pgrm;
     int64_t i_delay;
-    int i_total;
+    int i_total=0;
 
     if( es->fmt.i_cat == AUDIO_ES )
         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 )
     else
         i_delay = 0;
 
-    stats_UpdateInteger( p_input, "demux_read", p_block->i_buffer );
-    stats_GetInteger( p_input, p_input->i_object_id, "demux_read",
-                       &i_total );
-    stats_UpdateFloat( p_input , "demux_bitrate", (float)i_total );
+    if( p_input->p_libvlc->b_stats )
+    {
+        stats_UpdateInteger( p_input, "demux_read", p_block->i_buffer );
+        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 */
     if( es->i_preroll_end >= 0 )
index 10f676912713f788085ae50d98de1c2f2842d440..905248ff07ce7b5be7dcf844ae6722d37b2fac51 100644 (file)
@@ -1635,7 +1635,7 @@ static block_t *AReadBlock( stream_t *s, vlc_bool_t *pb_eof )
     {
         p_block = p_access->pf_block( p_access );
         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",
                                  p_block->i_buffer );
index 0155895d1a40c0ef27291a22be141c6c563edb94..b9df817cbc60d9d63e2a006308f295e908c6a0ac 100644 (file)
@@ -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 i_total;
-    /* Access_out -> sout_instance -> input_thread_t */
-    input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_access,
-                                        VLC_OBJECT_INPUT, FIND_PARENT );
-    if( p_input )
+    if( p_access->p_libvlc->b_stats )
     {
-        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 );
+        /* Access_out -> sout_instance -> input_thread_t */
+        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 );
+            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 );
 }