[vlc-commits] demux: vobsub: remove useless check and reindent

Francois Cartegnie git at videolan.org
Tue Oct 8 19:15:00 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct  8 12:52:00 2019 +0200| [44da22858ac8b2eb66412fadabe4adb2d51db68d] | committer: Francois Cartegnie

demux: vobsub: remove useless check and reindent

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

 modules/demux/vobsub.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/modules/demux/vobsub.c b/modules/demux/vobsub.c
index d75f2d53d0..c952977c2c 100644
--- a/modules/demux/vobsub.c
+++ b/modules/demux/vobsub.c
@@ -166,17 +166,14 @@ static int Open ( vlc_object_t *p_this )
 
     /* Find the total length of the vobsubs */
     p_sys->i_length = 0;
-    if( p_sys->i_tracks > 0 )
+    for( int i = 0; i < p_sys->i_tracks; i++ )
     {
-        for( int i = 0; i < p_sys->i_tracks; i++ )
-        {
-            if( p_sys->track[i].i_subtitles > 1 )
-            {
-                if( p_sys->track[i].p_subtitles[p_sys->track[i].i_subtitles-1].i_start > p_sys->i_length )
-                    p_sys->i_length = p_sys->track[i].p_subtitles[p_sys->track[i].i_subtitles-1].i_start;
-            }
-        }
+        if( !p_sys->track[i].i_subtitles )
+            continue;
+        if( p_sys->track[i].p_subtitles[p_sys->track[i].i_subtitles-1].i_start > p_sys->i_length )
+            p_sys->i_length = p_sys->track[i].p_subtitles[p_sys->track[i].i_subtitles-1].i_start;
     }
+
     if ( p_sys->i_length != 0)
         p_sys->i_length += VLC_TICK_FROM_SEC( 1 );
 



More information about the vlc-commits mailing list