[FFmpeg-cvslog] r20829 - in trunk/libavutil: avstring.c avstring.h avutil.h

michael subversion
Sun Dec 13 18:09:41 CET 2009


Author: michael
Date: Sun Dec 13 18:09:41 2009
New Revision: 20829

Log:
Add a function to convert a number to a av_malloced string.

Modified:
   trunk/libavutil/avstring.c
   trunk/libavutil/avstring.h
   trunk/libavutil/avutil.h

Modified: trunk/libavutil/avstring.c
==============================================================================
--- trunk/libavutil/avstring.c	Sun Dec 13 17:20:00 2009	(r20828)
+++ trunk/libavutil/avstring.c	Sun Dec 13 18:09:41 2009	(r20829)
@@ -76,3 +76,9 @@ size_t av_strlcatf(char *dst, size_t siz
 
     return len;
 }
+
+char *av_d2str(double d){
+    char *str= av_malloc(16);
+    if(str) snprintf(str, 16, "%f", d);
+    return str;
+}

Modified: trunk/libavutil/avstring.h
==============================================================================
--- trunk/libavutil/avstring.h	Sun Dec 13 17:20:00 2009	(r20828)
+++ trunk/libavutil/avstring.h	Sun Dec 13 18:09:41 2009	(r20829)
@@ -22,6 +22,7 @@
 #define AVUTIL_AVSTRING_H
 
 #include <stddef.h>
+#include "mem.h"
 
 /**
  * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to
@@ -95,4 +96,9 @@ size_t av_strlcat(char *dst, const char 
  */
 size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...);
 
+/**
+ * Convert a number to a av_malloced string.
+ */
+char *av_d2str(double d);
+
 #endif /* AVUTIL_AVSTRING_H */

Modified: trunk/libavutil/avutil.h
==============================================================================
--- trunk/libavutil/avutil.h	Sun Dec 13 17:20:00 2009	(r20828)
+++ trunk/libavutil/avutil.h	Sun Dec 13 18:09:41 2009	(r20829)
@@ -35,7 +35,7 @@
 #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
 
 #define LIBAVUTIL_VERSION_MAJOR 50
-#define LIBAVUTIL_VERSION_MINOR  6
+#define LIBAVUTIL_VERSION_MINOR  7
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list