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/parseutils.c (1 of 1 file). Show all

Unified · Split

libavfilter/parseutils.c+9−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
24 24
25#include <string.h>25#include <string.h>
26#include "libavutil/avutil.h"26#include "libavutil/avutil.h"
27#include "libavutil/random_seed.h"
27#include "parseutils.h"28#include "parseutils.h"
28 29
29#define WHITESPACES " \n\t"30#define WHITESPACES " \n\t"
@@ -216,6 +217,13 @@ static int color_table_compare(const void *lhs, const void *rhs) · 186 unmodified lines
216 217
217int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)218int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)
218{219{
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
219 if (!strncmp(color_string, "0x", 2)) {227 if (!strncmp(color_string, "0x", 2)) {
220 char *tail;228 char *tail;
221 int len = strlen(color_string);229 int len = strlen(color_string);
@@ -295,6 +303,7 @@ int main(void) · 73 unmodified lines
295 {303 {
296 uint8_t rgba[4];304 uint8_t rgba[4];
297 const char *color_names[] = {305 const char *color_names[] = {
306 "bikeshed",
298 "foo",307 "foo",
299 "red",308 "red",
300 "Red ",309 "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