]> git.sesse.net Git - vlc/commitdiff
Seek one less time. Should increase performance with access modules where
authorSigmund Augdal Helberg <sigmunau@videolan.org>
Tue, 18 Mar 2003 00:33:29 +0000 (00:33 +0000)
committerSigmund Augdal Helberg <sigmunau@videolan.org>
Tue, 18 Mar 2003 00:33:29 +0000 (00:33 +0000)
seeks are expensive. (Though not enough)

modules/demux/util/id3tag.c

index db94256b7aeb7562dcc0b133dc3e32117e74e458..fbbf729f811715849a3db86fcd5f2ddf7e4acca5 100644 (file)
@@ -2,7 +2,7 @@
  * id3tag.c: id3 tag parser/skipper based on libid3tag
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: id3tag.c,v 1.5 2003/03/13 22:35:51 sigmunau Exp $
+ * $Id: id3tag.c,v 1.6 2003/03/18 00:33:29 sigmunau Exp $
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
  * 
@@ -150,20 +150,15 @@ static int ParseID3Tags( vlc_object_t *p_this )
                 }
                 ParseID3Tag( p_input, p_peek, i_size2 );
             }
-        }
 
-        /* look for id3v2.4 tag at end of file */
-        if ( p_pos->i_size > 10 )
-        {
-            input_AccessReinit( p_input );
-            p_input->pf_seek( p_input, p_pos->i_size - 10 );
+            /* look for id3v2.4 tag at end of file */
             /* get 10 byte id3 footer */    
-            if( input_Peek( p_input, &p_peek, 10 ) < 10 )
+            if( input_Peek( p_input, &p_peek, 128 ) < 128 )
             {
                 msg_Err( p_input, "cannot peek()" );
                 return( VLC_EGENERIC );
             }
-            i_size2 = id3_tag_query( p_peek, 10 );
+            i_size2 = id3_tag_query( p_peek + 118, 10 );
             if ( i_size2 < 0  && p_pos->i_size > -i_size2 )
             {                                          /* id3v2.4 footer found */
                 input_AccessReinit( p_input );