History

Fix style: "if(" -> "if (".

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

Stefano Sabatini committed 16 years ago

Commit f219eee1 parent 968570d1 file · +34 −34Browse files

Unified · Split

libavfilter/graphparser.c+34−34
@@ -34,7 +34,7 @@ static int link_filter(AVFilterContext *src, int srcpad, · 33 unmodified lines
3434 AVFilterContext *dst, int dstpad,
3535 AVClass *log_ctx)
3636 {
37− if(avfilter_link(src, srcpad, dst, dstpad)) {
37+ if (avfilter_link(src, srcpad, dst, dstpad)) {
3838 av_log(log_ctx, AV_LOG_ERROR,
3939 "cannot create the link %s:%d -> %s:%d\n",
4040 src->filter->name, srcpad, dst->filter->name, dstpad);
@@ -57,13 +57,13 @@ static char *parse_link_name(const char **buf, AVClass *log_ctx) · 16 unmodified lines
5757
5858 name = av_get_token(buf, "]");
5959
60− if(!name[0]) {
60+ if (!name[0]) {
6161 av_log(log_ctx, AV_LOG_ERROR,
6262 "Bad (empty?) label found in the following: \"%s\".\n", start);
6363 goto fail;
6464 }
6565
66− if(*(*buf)++ != ']') {
66+ if (*(*buf)++ != ']') {
6767 av_log(log_ctx, AV_LOG_ERROR,
6868 "Mismatched '[' found in the following: \"%s\".\n", start);
6969 fail:
@@ -87,20 +87,20 @@ static AVFilterContext *create_filter(AVFilterGraph *ctx, int index, · 17 unmodified lines
8787
8888 filt = avfilter_get_by_name(filt_name);
8989
90− if(!filt) {
90+ if (!filt) {
9191 av_log(log_ctx, AV_LOG_ERROR,
9292 "no such filter: '%s'\n", filt_name);
9393 return NULL;
9494 }
9595
9696 filt_ctx = avfilter_open(filt, inst_name);
97− if(!filt_ctx) {
97+ if (!filt_ctx) {
9898 av_log(log_ctx, AV_LOG_ERROR,
9999 "error creating filter '%s'\n", filt_name);
100100 return NULL;
101101 }
102102
103− if(avfilter_graph_add_filter(ctx, filt_ctx) < 0) {
103+ if (avfilter_graph_add_filter(ctx, filt_ctx) < 0) {
104104 avfilter_destroy(filt_ctx);
105105 return NULL;
106106 }
@@ -111,7 +111,7 @@ static AVFilterContext *create_filter(AVFilterGraph *ctx, int index, · 4 unmodified lines
111111 args = tmp_args;
112112 }
113113
114− if(avfilter_init_filter(filt_ctx, args, NULL)) {
114+ if (avfilter_init_filter(filt_ctx, args, NULL)) {
115115 av_log(log_ctx, AV_LOG_ERROR,
116116 "error initializing filter '%s' with args '%s'\n", filt_name, args);
117117 return NULL;
@@ -130,7 +130,7 @@ static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph, · 12 unmodified lines
130130 char *name = av_get_token(buf, "=,;[\n");
131131 AVFilterContext *ret;
132132
133− if(**buf == '=') {
133+ if (**buf == '=') {
134134 (*buf)++;
135135 opts = av_get_token(buf, "[],;\n");
136136 }
@@ -143,7 +143,7 @@ static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph, · 6 unmodified lines
143143
144144 static void free_inout(AVFilterInOut *head)
145145 {
146− while(head) {
146+ while (head) {
147147 AVFilterInOut *next = head->next;
148148 av_free(head->name);
149149 av_free(head);
@@ -155,12 +155,12 @@ static AVFilterInOut *extract_inout(const char *label, AVFilterInOut **links) · 5 unmodified lines
155155 {
156156 AVFilterInOut *ret;
157157
158− while(*links && strcmp((*links)->name, label))
158+ while (*links && strcmp((*links)->name, label))
159159 links = &((*links)->next);
160160
161161 ret = *links;
162162
163− if(ret)
163+ if (ret)
164164 *links = ret->next;
165165
166166 return ret;
@@ -178,9 +178,9 @@ static int link_filter_inouts(AVFilterContext *filter, · 11 unmodified lines
178178 {
179179 int pad = filter->input_count;
180180
181− while(pad--) {
181+ while (pad--) {
182182 AVFilterInOut *p = *curr_inputs;
183− if(!p) {
183+ if (!p) {
184184 av_log(log_ctx, AV_LOG_ERROR,
185185 "Not enough inputs specified for the \"%s\" filter.\n",
186186 filter->filter->name);
@@ -189,8 +189,8 @@ static int link_filter_inouts(AVFilterContext *filter, · 2 unmodified lines
189189
190190 *curr_inputs = (*curr_inputs)->next;
191191
192− if(p->filter) {
193− if(link_filter(p->filter, p->pad_idx, filter, pad, log_ctx))
192+ if (p->filter) {
193+ if (link_filter(p->filter, p->pad_idx, filter, pad, log_ctx))
194194 return -1;
195195 av_free(p->name);
196196 av_free(p);
@@ -201,7 +201,7 @@ static int link_filter_inouts(AVFilterContext *filter, · 4 unmodified lines
201201 }
202202 }
203203
204− if(*curr_inputs) {
204+ if (*curr_inputs) {
205205 av_log(log_ctx, AV_LOG_ERROR,
206206 "Too many inputs specified for the \"%s\" filter.\n",
207207 filter->filter->name);
@@ -209,7 +209,7 @@ static int link_filter_inouts(AVFilterContext *filter, · 1 unmodified line
209209 }
210210
211211 pad = filter->output_count;
212− while(pad--) {
212+ while (pad--) {
213213 AVFilterInOut *currlinkn = av_mallocz(sizeof(AVFilterInOut));
214214 currlinkn->filter = filter;
215215 currlinkn->pad_idx = pad;
@@ -224,17 +224,17 @@ static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs, · 8 unmodified lines
224224 {
225225 int pad = 0;
226226
227− while(**buf == '[') {
227+ while (**buf == '[') {
228228 char *name = parse_link_name(buf, log_ctx);
229229 AVFilterInOut *match;
230230
231− if(!name)
231+ if (!name)
232232 return -1;
233233
234234 /* First check if the label is not in the open_outputs list */
235235 match = extract_inout(name, open_outputs);
236236
237− if(match) {
237+ if (match) {
238238 av_free(name);
239239 } else {
240240 /* Not in the list, so add it as an input */
@@ -258,22 +258,22 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs, · 17 unmodified lines
258258 {
259259 int pad = 0;
260260
261− while(**buf == '[') {
261+ while (**buf == '[') {
262262 char *name = parse_link_name(buf, log_ctx);
263263 AVFilterInOut *match;
264264
265265 AVFilterInOut *input = *curr_inputs;
266266 *curr_inputs = (*curr_inputs)->next;
267267
268− if(!name)
268+ if (!name)
269269 return -1;
270270
271271 /* First check if the label is not in the open_inputs list */
272272 match = extract_inout(name, open_inputs);
273273
274− if(match) {
275− if(link_filter(input->filter, input->pad_idx,
276− match->filter, match->pad_idx, log_ctx) < 0)
274+ if (match) {
275+ if (link_filter(input->filter, input->pad_idx,
276+ match->filter, match->pad_idx, log_ctx) < 0)
277277 return -1;
278278 av_free(match->name);
279279 av_free(name);
@@ -304,39 +304,39 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, · 24 unmodified lines
304304 AVFilterContext *filter;
305305 filters += strspn(filters, WHITESPACES);
306306
307− if(parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx) < 0)
307+ if (parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx) < 0)
308308 goto fail;
309309
310310 filter = parse_filter(&filters, graph, index, log_ctx);
311311
312− if(!filter)
312+ if (!filter)
313313 goto fail;
314314
315− if(filter->input_count == 1 && !curr_inputs && !index) {
315+ if (filter->input_count == 1 && !curr_inputs && !index) {
316316 /* First input can be omitted if it is "[in]" */
317317 const char *tmp = "[in]";
318318 if(parse_inputs(&tmp, &curr_inputs, &open_outputs, log_ctx) < 0)
319319 goto fail;
320320 }
321321
322− if(link_filter_inouts(filter, &curr_inputs, &open_inputs, log_ctx) < 0)
322+ if (link_filter_inouts(filter, &curr_inputs, &open_inputs, log_ctx) < 0)
323323 goto fail;
324324
325− if(parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
325+ if (parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
326326 log_ctx) < 0)
327327 goto fail;
328328
329329 filters += strspn(filters, WHITESPACES);
330330 chr = *filters++;
331331
332− if(chr == ';' && curr_inputs) {
332+ if (chr == ';' && curr_inputs) {
333333 av_log(log_ctx, AV_LOG_ERROR,
334334 "Could not find a output to link when parsing \"%s\"\n",
335335 filters - 1);
336336 goto fail;
337337 }
338338 index++;
339− } while(chr == ',' || chr == ';');
339+ } while (chr == ',' || chr == ';');
340340
341341 if (chr) {
342342 av_log(log_ctx, AV_LOG_ERROR,
@@ -345,10 +345,10 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, · 2 unmodified lines
345345 goto fail;
346346 }
347347
348− if(open_inputs && !strcmp(open_inputs->name, "out") && curr_inputs) {
348+ if (open_inputs && !strcmp(open_inputs->name, "out") && curr_inputs) {
349349 /* Last output can be omitted if it is "[out]" */
350350 const char *tmp = "[out]";
351− if(parse_outputs(&tmp, &curr_inputs, &open_inputs,
351+ if (parse_outputs(&tmp, &curr_inputs, &open_inputs,
352352 &open_outputs, log_ctx) < 0)
353353 goto fail;
354354 }

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