Originally committed as revision 18828 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -217,7 +217,7 @@ static int color_table_compare(const void *lhs, const void *rhs) · 216 unmodified lines | ||
| 217 | 217 | |
| 218 | 218 | int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx) |
| 219 | 219 | { |
| 220 | − if (!strcasecmp(color_string, "bikeshed")) { | |
| 220 | + if (!strcasecmp(color_string, "random") || !strcasecmp(color_string, "bikeshed")) { | |
| 221 | 221 | int rgba = ff_random_get_seed(); |
| 222 | 222 | rgba_color[0] = rgba >> 24; |
| 223 | 223 | rgba_color[1] = rgba >> 16; |
| @@ -304,6 +304,7 @@ int main(void) · 80 unmodified lines | ||
| 304 | 304 | uint8_t rgba[4]; |
| 305 | 305 | const char *color_names[] = { |
| 306 | 306 | "bikeshed", |
| 307 | + "RaNdOm", | |
| 307 | 308 | "foo", |
| 308 | 309 | "red", |
| 309 | 310 | "Red ", |
| @@ -45,6 +45,7 @@ char *av_get_token(const char **buf, const char *term); · 44 unmodified lines | ||
| 45 | 45 | * |
| 46 | 46 | * @param color_string a string specifying a color. It can be the name of |
| 47 | 47 | * a color (case insensitive match) or a 0xRRGGBB[AA] sequence. |
| 48 | + * The string "random" will result in a random color. | |
| 48 | 49 | * @return >= 0 in case of success, a negative value in case of |
| 49 | 50 | * failure (for example if color_string cannot be parsed). |
| 50 | 51 | */ |