changeset 24442:9fc610537539

Use strtol instead of horribly suboptimal ty_octaltodecimal
author reimar
date Fri, 14 Sep 2007 15:12:46 +0000
parents ace95ae92f21
children 96dc3e753182
files libmpdemux/demux_ty.c
diffstat 1 files changed, 1 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ty.c	Fri Sep 14 14:45:08 2007 +0000
+++ b/libmpdemux/demux_ty.c	Fri Sep 14 15:12:46 2007 +0000
@@ -122,26 +122,6 @@
 // ===========================================================================
 #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 @@
       }
       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++;