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

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


Author: reimar
Date: Fri Sep 14 17:28:47 2007
New Revision: 24464

Log:
Simplify ty_extensionis


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:28:47 2007
@@ -123,15 +123,12 @@ void ty_ClearOSD( int start );
 #define TMF_SIG "showing.xml"
 
 // ===========================================================================
-static int ty_extensionis( char *name, char *ext )
+static int ty_extensionis(const char *name, const char *ext )
 {
-   char *ptr;
-
-   if ( strlen( ext ) > strlen( name ) ) return( 0 );
-   ptr = name;
-   ptr += ( strlen( name ) - strlen( ext ) );
-   if ( strcmp( ptr, ext ) == 0 ) return( 1 );
-   return( 0 );
+   int delta = strlen(name) - strlen(ext);
+   if (delta < 0) return 0;
+   name += delta;
+   return strcmp(name, ext) == 0;
 }
 
 



More information about the MPlayer-cvslog mailing list