[vlc-commits] decoder synchro: cosmetics

Rafaël Carré git at videolan.org
Wed Feb 29 23:10:09 CET 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Wed Feb 29 17:09:11 2012 -0500| [3414682cbdc046cfe0be16df0abbed5a87ac1fbc] | committer: Rafaël Carré

decoder synchro: cosmetics

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

 src/input/decoder_synchro.c |   36 +++++++++++++++++-------------------
 1 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/src/input/decoder_synchro.c b/src/input/decoder_synchro.c
index 16ab728..576d06a 100644
--- a/src/input/decoder_synchro.c
+++ b/src/input/decoder_synchro.c
@@ -369,25 +369,24 @@ void decoder_SynchroEnd( decoder_synchro_t * p_synchro, int i_coding_type,
 {
     mtime_t     tau;
 
-    if( !b_garbage )
-    {
-        tau = mdate() - p_synchro->decoding_start;
+    if( b_garbage )
+        return;
+
+    tau = mdate() - p_synchro->decoding_start;
 
-        /* If duration too high, something happened (pause ?), so don't
-         * take it into account. */
-        if( tau < 3 * p_synchro->p_tau[i_coding_type]
-             || ( !p_synchro->pi_meaningful[i_coding_type]
-                   && tau < MAX_VALID_TAU ) )
+    /* If duration too high, something happened (pause ?), so don't
+     * take it into account. */
+    if( tau < 3 * p_synchro->p_tau[i_coding_type] ||
+          ( !p_synchro->pi_meaningful[i_coding_type] && tau < MAX_VALID_TAU ) )
+    {
+        /* Mean with average tau, to ensure stability. */
+        p_synchro->p_tau[i_coding_type] =
+            (p_synchro->pi_meaningful[i_coding_type]
+             * p_synchro->p_tau[i_coding_type] + tau)
+            / (p_synchro->pi_meaningful[i_coding_type] + 1);
+        if( p_synchro->pi_meaningful[i_coding_type] < MAX_PIC_AVERAGE )
         {
-            /* Mean with average tau, to ensure stability. */
-            p_synchro->p_tau[i_coding_type] =
-                (p_synchro->pi_meaningful[i_coding_type]
-                 * p_synchro->p_tau[i_coding_type] + tau)
-                / (p_synchro->pi_meaningful[i_coding_type] + 1);
-            if( p_synchro->pi_meaningful[i_coding_type] < MAX_PIC_AVERAGE )
-            {
-                p_synchro->pi_meaningful[i_coding_type]++;
-            }
+            p_synchro->pi_meaningful[i_coding_type]++;
         }
     }
 }
@@ -416,8 +415,7 @@ void decoder_SynchroNewPicture( decoder_synchro_t * p_synchro, int i_coding_type
     switch( i_coding_type )
     {
     case I_CODING_TYPE:
-        if( p_synchro->i_eta_p
-             && p_synchro->i_eta_p != p_synchro->i_n_p )
+        if( p_synchro->i_eta_p && p_synchro->i_eta_p != p_synchro->i_n_p )
         {
 #if 0
             if( !p_synchro->b_quiet )



More information about the vlc-commits mailing list