[FFmpeg-cvslog] r25719 - in trunk/libavfilter: avfilter.h parseutils.c parseutils.h

aurel subversion
Thu Nov 11 00:37:12 CET 2010


Author: aurel
Date: Thu Nov 11 00:37:12 2010
New Revision: 25719

Log:
drop support for base-10 encoded alpha component in av_parse_color()

Modified:
   trunk/libavfilter/avfilter.h
   trunk/libavfilter/parseutils.c
   trunk/libavfilter/parseutils.h

Modified: trunk/libavfilter/avfilter.h
==============================================================================
--- trunk/libavfilter/avfilter.h	Wed Nov 10 21:13:24 2010	(r25718)
+++ trunk/libavfilter/avfilter.h	Thu Nov 11 00:37:12 2010	(r25719)
@@ -25,7 +25,7 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVFILTER_VERSION_MAJOR  1
-#define LIBAVFILTER_VERSION_MINOR 59
+#define LIBAVFILTER_VERSION_MINOR 60
 #define LIBAVFILTER_VERSION_MICRO  0
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \

Modified: trunk/libavfilter/parseutils.c
==============================================================================
--- trunk/libavfilter/parseutils.c	Wed Nov 10 21:13:24 2010	(r25718)
+++ trunk/libavfilter/parseutils.c	Thu Nov 11 00:37:12 2010	(r25719)
@@ -233,11 +233,7 @@ int av_parse_color(uint8_t *rgba_color, 
         if (!strncmp(alpha_string, "0x", 2)) {
             alpha = strtoul(alpha_string, &tail, 16);
         } else {
-            alpha = strtoul(alpha_string, &tail, 10);
-            if (*tail) {
-                double d = strtod(alpha_string, &tail);
-                alpha = d * 255;
-            }
+            alpha = 255 * strtod(alpha_string, &tail);
         }
 
         if (tail == alpha_string || *tail || alpha > 255) {

Modified: trunk/libavfilter/parseutils.h
==============================================================================
--- trunk/libavfilter/parseutils.h	Wed Nov 10 21:13:24 2010	(r25718)
+++ trunk/libavfilter/parseutils.h	Thu Nov 11 00:37:12 2010	(r25719)
@@ -35,11 +35,10 @@
  * possibly followed by "@" and a string representing the alpha
  * component.
  * The alpha component may be a string composed by "0x" followed by an
- * hexadecimal number or a base-10 number between 0 and 255, or a
- * decimal number between 0.0 and 1.0, which represents the opacity
- * value (0/0x00/0.0 means completely transparent, 255/0xff/1.0
- * completely opaque).
- * If the alpha component is not specified then 255 is assumed.
+ * hexadecimal number or a decimal number between 0.0 and 1.0, which
+ * represents the opacity value (0x00/0.0 means completely transparent,
+ * 0xff/1.0 completely opaque).
+ * If the alpha component is not specified then 0xff is assumed.
  * The string "random" will result in a random color.
  * @return >= 0 in case of success, a negative value in case of
  * failure (for example if color_string cannot be parsed).



More information about the ffmpeg-cvslog mailing list