[vlc-commits] aout: use unsigned stats

Rémi Denis-Courmont git at videolan.org
Tue Jan 26 19:29:02 CET 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jan 26 20:16:09 2016 +0200| [b758d168138edba2c8799e0ba145407b63a12b60] | committer: Rémi Denis-Courmont

aout: use unsigned stats

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b758d168138edba2c8799e0ba145407b63a12b60
---

 src/audio_output/aout_internal.h |    2 +-
 src/audio_output/dec.c           |    2 +-
 src/input/decoder.c              |   22 ++++++++++------------
 3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index ec729fb..8cfcf33 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -137,7 +137,7 @@ int aout_DecNew(audio_output_t *, const audio_sample_format_t *,
                 const audio_replay_gain_t *, const aout_request_vout_t *);
 void aout_DecDelete(audio_output_t *);
 int aout_DecPlay(audio_output_t *, block_t *, int i_input_rate);
-int aout_DecGetResetLost(audio_output_t *);
+unsigned aout_DecGetResetLost(audio_output_t *);
 void aout_DecChangePause(audio_output_t *, bool b_paused, mtime_t i_date);
 void aout_DecFlush(audio_output_t *, bool wait);
 void aout_RequestRestart (audio_output_t *, unsigned);
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 9d4958b..50ad86d 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -395,7 +395,7 @@ lost:
     goto out;
 }
 
-int aout_DecGetResetLost (audio_output_t *aout)
+unsigned aout_DecGetResetLost (audio_output_t *aout)
 {
     aout_owner_t *owner = aout_owner (aout);
     return atomic_exchange(&owner->buffers_lost, 0);
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 262a6d2..8ef1fd5 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1038,7 +1038,8 @@ static void DecoderProcessVideo( decoder_t *p_dec, block_t *p_block )
 }
 
 static int DecoderPlayAudio( decoder_t *p_dec, block_t *p_audio,
-                             int *pi_played_sum, int *pi_lost_sum )
+                             unsigned *restrict pi_played_sum,
+                             unsigned *restrict pi_lost_sum )
 {
     decoder_owner_sys_t *p_owner = p_dec->p_owner;
     bool prerolled;
@@ -1109,8 +1110,8 @@ static int DecoderPlayAudio( decoder_t *p_dec, block_t *p_audio,
     return 0;
 }
 
-static void DecoderUpdateStatAudio( decoder_t *p_dec, int i_decoded,
-                                    int i_lost, int i_played )
+static void DecoderUpdateStatAudio( decoder_t *p_dec, unsigned decoded,
+                                    unsigned lost, unsigned played )
 {
     decoder_owner_sys_t *p_owner = p_dec->p_owner;
     input_thread_t *p_input = p_owner->p_input;
@@ -1120,19 +1121,18 @@ static void DecoderUpdateStatAudio( decoder_t *p_dec, int i_decoded,
         return;
 
     if( p_owner->p_aout != NULL )
-        i_lost += aout_DecGetResetLost( p_owner->p_aout );
+        lost += aout_DecGetResetLost( p_owner->p_aout );
 
     vlc_mutex_lock( &p_input->p->counters.counters_lock);
-    stats_Update( p_input->p->counters.p_lost_abuffers, i_lost, NULL );
-    stats_Update( p_input->p->counters.p_played_abuffers, i_played, NULL );
-    stats_Update( p_input->p->counters.p_decoded_audio, i_decoded, NULL );
+    stats_Update( p_input->p->counters.p_lost_abuffers, lost, NULL );
+    stats_Update( p_input->p->counters.p_played_abuffers, played, NULL );
+    stats_Update( p_input->p->counters.p_decoded_audio, decoded, NULL );
     vlc_mutex_unlock( &p_input->p->counters.counters_lock);
 }
 
 static int DecoderQueueAudio( decoder_t *p_dec, block_t *p_aout_buf )
 {
-    int i_lost = 0;
-    int i_played = 0;
+    unsigned i_lost = 0, i_played = 0;
 
     int ret = DecoderPlayAudio( p_dec, p_aout_buf, &i_played, &i_lost );
 
@@ -1145,9 +1145,7 @@ static void DecoderDecodeAudio( decoder_t *p_dec, block_t *p_block )
 {
     block_t *p_aout_buf;
     block_t **pp_block = p_block ? &p_block : NULL;
-    int i_decoded = 0;
-    int i_lost = 0;
-    int i_played = 0;
+    unsigned i_decoded = 0, i_lost = 0, i_played = 0;
 
     while( (p_aout_buf = p_dec->pf_decode_audio( p_dec, pp_block ) ) )
     {



More information about the vlc-commits mailing list