summaryrefslogtreecommitdiff
path: root/libavfilter/parseutils.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2009-05-14 18:58:06 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2009-05-14 18:58:06 +0000
commit3d3bd64db8a319cf40aea3587f346f0ac0805b9b (patch)
treef7ffcbad0895466c3c581bfb5c583bda23a81105 /libavfilter/parseutils.c
parentb69b622c22879b807220576100d0cf7b058e072f (diff)
Add support in av_parse_color() to a "random" color name, which will
result in a randomly choosen random color, as it is with the "bikeshed" color. Originally committed as revision 18828 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/parseutils.c')
-rw-r--r--libavfilter/parseutils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/parseutils.c b/libavfilter/parseutils.c
index 13fa58199e..85effb06c1 100644
--- a/libavfilter/parseutils.c
+++ b/libavfilter/parseutils.c
@@ -217,7 +217,7 @@ 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 (!strcasecmp(color_string, "bikeshed")) {
+ if (!strcasecmp(color_string, "random") || !strcasecmp(color_string, "bikeshed")) {
int rgba = ff_random_get_seed();
rgba_color[0] = rgba >> 24;
rgba_color[1] = rgba >> 16;
@@ -304,6 +304,7 @@ int main(void)
uint8_t rgba[4];
const char *color_names[] = {
"bikeshed",
+ "RaNdOm",
"foo",
"red",
"Red ",