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

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Sep  6 12:08:38 2019 +0200| [ff9c24f357e8c48e3a40efbf306d579d3f87b680] | committer: Steve Lhomme

decoder: simplify the lost picture stat handling

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

 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 6e48db8966..54458050cf 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1067,19 +1067,17 @@ static int ModuleThread_PlayVideo( struct decoder_owner *p_owner, picture_t *p_p
 }
 
 static void ModuleThread_UpdateStatVideo( struct decoder_owner *p_owner,
-                                          unsigned lost )
+                                          bool lost )
 {
     unsigned displayed = 0;
-
+    unsigned vout_lost = 0;
     if( p_owner->p_vout != NULL )
     {
-        unsigned vout_lost = 0;
-
         vout_GetResetStatistic( p_owner->p_vout, &displayed, &vout_lost );
-        lost += vout_lost;
     }
+    if (lost) vout_lost++;
 
-    decoder_Notify(p_owner, on_new_video_stats, 1, lost, displayed);
+    decoder_Notify(p_owner, on_new_video_stats, 1, vout_lost, displayed);
 }
 
 static void ModuleThread_QueueVideo( decoder_t *p_dec, picture_t *p_pic )
@@ -1089,7 +1087,7 @@ static void ModuleThread_QueueVideo( decoder_t *p_dec, picture_t *p_pic )
 
     int success = ModuleThread_PlayVideo( p_owner, p_pic );
 
-    ModuleThread_UpdateStatVideo( p_owner, success != VLC_SUCCESS ? 1 : 0 );
+    ModuleThread_UpdateStatVideo( p_owner, success != VLC_SUCCESS );
 }
 
 static int thumbnailer_update_format( decoder_t *p_dec )



More information about the vlc-commits mailing list