[vlc-commits] decoder: simplify the lost audio block stat handling

Steve Lhomme git at videolan.org
Thu Sep 12 15:57:15 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Sep  6 12:09:21 2019 +0200| [73329b347b3c6fc6285cc7a0664aaad33c1b2d93] | committer: Steve Lhomme

decoder: simplify the lost audio block stat handling

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

 src/input/decoder.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 54458050cf..65072af942 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1190,19 +1190,17 @@ static int ModuleThread_PlayAudio( struct decoder_owner *p_owner, block_t *p_aud
 }
 
 static void ModuleThread_UpdateStatAudio( struct decoder_owner *p_owner,
-                                          unsigned lost )
+                                          bool lost )
 {
     unsigned played = 0;
-
+    unsigned aout_lost = 0;
     if( p_owner->p_aout != NULL )
     {
-        unsigned aout_lost;
-
         aout_DecGetResetStats( p_owner->p_aout, &aout_lost, &played );
-        lost += aout_lost;
     }
+    if (lost) aout_lost++;
 
-    decoder_Notify(p_owner, on_new_audio_stats, 1, lost, played);
+    decoder_Notify(p_owner, on_new_audio_stats, 1, aout_lost, played);
 }
 
 static void ModuleThread_QueueAudio( decoder_t *p_dec, block_t *p_aout_buf )
@@ -1211,7 +1209,7 @@ static void ModuleThread_QueueAudio( decoder_t *p_dec, block_t *p_aout_buf )
 
     int success = ModuleThread_PlayAudio( p_owner, p_aout_buf );
 
-    ModuleThread_UpdateStatAudio( p_owner, success != VLC_SUCCESS ? 1 : 0 );
+    ModuleThread_UpdateStatAudio( p_owner, success != VLC_SUCCESS );
 }
 
 static void ModuleThread_PlaySpu( struct decoder_owner *p_owner, subpicture_t *p_subpic )



More information about the vlc-commits mailing list