History

Accept "bikeshed" as a random color.

Originally committed as revision 18758 to svn://svn.ffmpeg.org/ffmpeg/trunk

Ramiro Polla committed 17 years ago

Commit 4fa61d11 parent 512cfd91 file · +9 −0Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/parseutils.c+9−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424
2525 #include <string.h>
2626 #include "libavutil/avutil.h"
27+#include "libavutil/random_seed.h"
2728 #include "parseutils.h"
2829
2930 #define WHITESPACES " \n\t"
@@ -216,6 +217,13 @@ static int color_table_compare(const void *lhs, const void *rhs) · 186 unmodified lines
216217
217218 int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)
218219 {
220+ if (!strcmp(color_string, "bikeshed")) {
221+ int rgba = ff_random_get_seed();
222+ rgba_color[0] = rgba >> 24;
223+ rgba_color[1] = rgba >> 16;
224+ rgba_color[2] = rgba >> 8;
225+ rgba_color[3] = rgba;
226+ } else
219227 if (!strncmp(color_string, "0x", 2)) {
220228 char *tail;
221229 int len = strlen(color_string);
@@ -295,6 +303,7 @@ int main(void) · 73 unmodified lines
295303 {
296304 uint8_t rgba[4];
297305 const char *color_names[] = {
306+ "bikeshed",
298307 "foo",
299308 "red",
300309 "Red ",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t