diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2009-05-06 15:25:30 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2009-05-06 15:25:30 +0000 |
commit | 4fa61d1e982ea96f5376959c2abcab4eafddf98a (patch) | |
tree | f0f94abe09f386dc479738f0029407b46daffc22 /libavfilter | |
parent | 512cfd9d540a592a932e26a13fc0a28421cdd621 (diff) | |
download | ffmpeg-4fa61d1e982ea96f5376959c2abcab4eafddf98a.tar.gz |
Accept "bikeshed" as a random color.
Originally committed as revision 18758 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/parseutils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavfilter/parseutils.c b/libavfilter/parseutils.c index 656a67e164..9ee1ae6db2 100644 --- a/libavfilter/parseutils.c +++ b/libavfilter/parseutils.c @@ -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 void *lhs, const void *rhs) 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 ", |