[MPlayer-cvslog] r24462 - trunk/libmpdemux/demux_ty.c

reimar subversion at mplayerhq.hu
Fri Sep 14 17:12:47 CEST 2007


Author: reimar
Date: Fri Sep 14 17:12:46 2007
New Revision: 24462

Log:
Use strtol instead of horribly suboptimal ty_octaltodecimal


Modified:
   trunk/libmpdemux/demux_ty.c

Modified: trunk/libmpdemux/demux_ty.c
==============================================================================
--- trunk/libmpdemux/demux_ty.c	(original)
+++ trunk/libmpdemux/demux_ty.c	Fri Sep 14 17:12:46 2007
@@ -122,26 +122,6 @@ void ty_ClearOSD( int start );
 // ===========================================================================
 #define TMF_SIG "showing.xml"
 
-int ty_octaltodecimal( char *num )
-{
-   int i;
-   int result = 0;
-   int len;
-   int mult;
-
-   len = strlen( num );
-   mult = 1;
-
-   for ( i = ( len - 1 ) ; i >= 0 ; i-- )
-   {
-      result += ( ( num[ i ] - '0') * mult );
-      mult *= 8;
-   }
-   return( result );
-}
-
-
-
 // ===========================================================================
 int ty_extensionis( char *name, char *ext )
 {
@@ -204,7 +184,7 @@ int ty_tmf_filetoparts( demuxer_t *demux
       }
       av_strlcpy( name, &header[ 0 ], 100 );
       av_strlcpy( sizestr, &header[ 124 ], 12 );
-      size = ty_octaltodecimal( sizestr );
+      size = strtol(sizestr, NULL, 8);
 
       blocks = size / 512;
       if ( ( size % 512 ) > 0 ) blocks++;



More information about the MPlayer-cvslog mailing list