[SCM] libav/experimental: drop support for base-10 encoded alpha component in av_parse_color()

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:18:52 UTC 2013


The following commit has been merged in the experimental branch:
commit 6ed3bace9708fad6a656a187a3b182bba21006fa
Author: Aurelien Jacobs <aurel at gnuage.org>
Date:   Wed Nov 10 23:37:12 2010 +0000

    drop support for base-10 encoded alpha component in av_parse_color()
    
    Originally committed as revision 25719 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 18feadc..5ee7887 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -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, \
diff --git a/libavfilter/parseutils.c b/libavfilter/parseutils.c
index b8923ed..6609f08 100644
--- a/libavfilter/parseutils.c
+++ b/libavfilter/parseutils.c
@@ -233,11 +233,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)
         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) {
diff --git a/libavfilter/parseutils.h b/libavfilter/parseutils.h
index c9b6e46..e1bd552 100644
--- a/libavfilter/parseutils.h
+++ b/libavfilter/parseutils.h
@@ -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).

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list