[FFmpeg-cvslog] r18758 - trunk/libavfilter/parseutils.c

ramiro subversion
Wed May 6 17:25:30 CEST 2009


Author: ramiro
Date: Wed May  6 17:25:30 2009
New Revision: 18758

Log:
Accept "bikeshed" as a random color.

Modified:
   trunk/libavfilter/parseutils.c

Modified: trunk/libavfilter/parseutils.c
==============================================================================
--- trunk/libavfilter/parseutils.c	Wed May  6 14:12:05 2009	(r18757)
+++ trunk/libavfilter/parseutils.c	Wed May  6 17:25:30 2009	(r18758)
@@ -24,6 +24,7 @@
 
 #include <string.h>
 #include "libavutil/avutil.h"
+#include "libavutil/random_seed.h"
 #include "parseutils.h"
 
 #define WHITESPACES " \n\t"
@@ -216,6 +217,13 @@ static int color_table_compare(const voi
 
 int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)
 {
+    if (!strcmp(color_string, "bikeshed")) {
+        int rgba = ff_random_get_seed();
+        rgba_color[0] = rgba >> 24;
+        rgba_color[1] = rgba >> 16;
+        rgba_color[2] = rgba >> 8;
+        rgba_color[3] = rgba;
+    } else
     if (!strncmp(color_string, "0x", 2)) {
         char *tail;
         int len = strlen(color_string);
@@ -295,6 +303,7 @@ int main(void)
     {
         uint8_t rgba[4];
         const char *color_names[] = {
+            "bikeshed",
             "foo",
             "red",
             "Red ",



More information about the ffmpeg-cvslog mailing list