]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Make case insensitive the match for the color name in
authorstefano <stefano@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Thu, 14 May 2009 18:54:25 +0000 (18:54 +0000)
committerstefano <stefano@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Thu, 14 May 2009 18:54:25 +0000 (18:54 +0000)
av_parse_color().

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18827 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavfilter/parseutils.c
libavfilter/parseutils.h

index 9ee1ae6db259da1342241e4e3bdc275e9f1296cf..13fa58199e3c1e2a335bd21c02b002e609afdf92 100644 (file)
@@ -22,7 +22,7 @@
  * parsing utils
  */
 
-#include <string.h>
+#include <strings.h>
 #include "libavutil/avutil.h"
 #include "libavutil/random_seed.h"
 #include "parseutils.h"
@@ -212,12 +212,12 @@ static ColorEntry color_table[] = {
 
 static int color_table_compare(const void *lhs, const void *rhs)
 {
-    return strcmp(lhs, ((const ColorEntry *)rhs)->name);
+    return strcasecmp(lhs, ((const ColorEntry *)rhs)->name);
 }
 
 int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)
 {
-    if (!strcmp(color_string, "bikeshed")) {
+    if (!strcasecmp(color_string, "bikeshed")) {
         int rgba = ff_random_get_seed();
         rgba_color[0] = rgba >> 24;
         rgba_color[1] = rgba >> 16;
index 895c5067aa897774adcd26654f87a66fa227e4a0..52df8212a5a5458434575b47c040a7e4c001920f 100644 (file)
@@ -44,7 +44,7 @@ char *av_get_token(const char **buf, const char *term);
  * Puts the RGBA values that correspond to color_string in rgba_color.
  *
  * @param color_string a string specifying a color. It can be the name of
- * a color or a 0xRRGGBB[AA] sequence.
+ * a color (case insensitive match) or a 0xRRGGBB[AA] sequence.
  * @return >= 0 in case of success, a negative value in case of
  * failure (for example if color_string cannot be parsed).
  */