[FFmpeg-cvslog] r21080 - trunk/libavformat/os_support.c

rbultje subversion
Fri Jan 8 01:04:23 CET 2010


Author: rbultje
Date: Fri Jan  8 01:04:23 2010
New Revision: 21080

Log:
Currently, the replacement which is used if inet_aton isn't available,
only works correctly on little-endian. The attached patch makes it endian
independent.

Patch by Martin Storsjo <$firstname()$firstname,st>.

Modified:
   trunk/libavformat/os_support.c

Modified: trunk/libavformat/os_support.c
==============================================================================
--- trunk/libavformat/os_support.c	Fri Jan  8 00:53:49 2010	(r21079)
+++ trunk/libavformat/os_support.c	Fri Jan  8 01:04:23 2010	(r21080)
@@ -54,7 +54,7 @@ int inet_aton (const char * str, struct 
 
     if (!add1 || (add1|add2|add3|add4) > 255) return 0;
 
-    add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1;
+    add->s_addr = htonl((add1 << 24) + (add2 << 16) + (add3 << 8) + add4);
 
     return 1;
 }



More information about the ffmpeg-cvslog mailing list