[x264-devel] commit: Use the correct strtok under MSVC (Steven Walters )

git version control git at videolan.org
Wed Dec 31 14:28:01 CET 2008


x264 | branch: master | Steven Walters <kemuri9 at gmail.com> | Tue Dec 30 22:20:37 2008 -0500| [ed32ad20d6914d1781c7711574f10a8df49e3e20] | committer: Jason Garrett-Glaser 

Use the correct strtok under MSVC
Also change one malloc -> x264_malloc

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=ed32ad20d6914d1781c7711574f10a8df49e3e20
---

 common/osdep.h        |    1 +
 encoder/ratecontrol.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/common/osdep.h b/common/osdep.h
index 25bb138..94d5c1a 100644
--- a/common/osdep.h
+++ b/common/osdep.h
@@ -47,6 +47,7 @@
 #define fseek _fseeki64
 #define ftell _ftelli64
 #define isfinite _finite
+#define strtok_r strtok_s
 #define _CRT_SECURE_NO_DEPRECATE
 #define X264_VERSION "" // no configure script for msvc
 #endif
diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index 2b876d3..b74a056 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -612,7 +612,7 @@ static int parse_zone( x264_t *h, x264_zone_t *z, char *p )
     p += len;
     if( !*p )
         return 0;
-    z->param = malloc( sizeof(x264_param_t) );
+    z->param = x264_malloc( sizeof(x264_param_t) );
     memcpy( z->param, &h->param, sizeof(x264_param_t) );
     while( (tok = strtok_r( p, ",", &saveptr )) )
     {



More information about the x264-devel mailing list