[vlc-commits] Merge if conditions

Tobias Güntner git at videolan.org
Mon Aug 22 21:12:21 CEST 2011


vlc | branch: master | Tobias Güntner <fatbull at web.de> | Tue Aug 16 21:13:33 2011 +0000| [a9852371c349013a8503b28f03adba1da6f05614] | committer: Rémi Denis-Courmont

Merge if conditions

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 modules/demux/ps.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/modules/demux/ps.c b/modules/demux/ps.c
index 51361bf..dd4f729 100644
--- a/modules/demux/ps.c
+++ b/modules/demux/ps.c
@@ -260,20 +260,21 @@ static void FindLength( demux_t *p_demux )
         if( i_current_pos >= 0 ) stream_Seek( p_demux->s, i_current_pos );
     }
 
+    /* Find the longest track */
     for( int i = 0; i < PS_TK_COUNT; i++ )
     {
         ps_track_t *tk = &p_sys->tk[i];
-        if( tk->i_first_pts >= 0 && tk->i_last_pts > 0 )
-            if( tk->i_last_pts > tk->i_first_pts )
+        if( tk->i_first_pts >= 0 && tk->i_last_pts > 0 &&
+            tk->i_last_pts > tk->i_first_pts )
+        {
+            int64_t i_length = (int64_t)tk->i_last_pts - tk->i_first_pts;
+            if( i_length > p_sys->i_length )
             {
-                int64_t i_length = (int64_t)tk->i_last_pts - tk->i_first_pts;
-                if( i_length > p_sys->i_length )
-                {
-                    p_sys->i_length = i_length;
-                    p_sys->i_time_track = i;
-                    msg_Dbg( p_demux, "we found a length of: %"PRId64, p_sys->i_length );
-                }
+                p_sys->i_length = i_length;
+                p_sys->i_time_track = i;
+                msg_Dbg( p_demux, "we found a length of: %"PRId64, p_sys->i_length );
             }
+        }
     }
 }
 



More information about the vlc-commits mailing list