Originally committed as revision 16356 to svn://svn.ffmpeg.org/ffmpeg/trunk
Showing the changes to libavfilter/graphparser.c (1 of 1 file). Show all
Unified · Split
| @@ -211,13 +211,13 @@ static void insert_inout(AVFilterInOut **inouts, AVFilterInOut *element) · 210 unmodified lines | ||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | static int link_filter_inouts(AVFilterContext *filter, |
| 214 | − AVFilterInOut **currInputs, | |
| 215 | − AVFilterInOut **openInputs, AVClass *log_ctx) | |
| 214 | + AVFilterInOut **curr_inputs, | |
| 215 | + AVFilterInOut **open_inputs, AVClass *log_ctx) | |
| 216 | 216 | { |
| 217 | 217 | int pad = filter->input_count; |
| 218 | 218 | |
| 219 | 219 | while(pad--) { |
| 220 | − AVFilterInOut *p = *currInputs; | |
| 220 | + AVFilterInOut *p = *curr_inputs; | |
| 221 | 221 | if(!p) { |
| 222 | 222 | av_log(log_ctx, AV_LOG_ERROR, |
| 223 | 223 | "Not enough inputs specified for the \"%s\" filter.\n", |
| @@ -225,7 +225,7 @@ static int link_filter_inouts(AVFilterContext *filter, · 1 unmodified line | ||
| 225 | 225 | return -1; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | − *currInputs = (*currInputs)->next; | |
| 228 | + *curr_inputs = (*curr_inputs)->next; | |
| 229 | 229 | |
| 230 | 230 | if(p->filter) { |
| 231 | 231 | if(link_filter(p->filter, p->pad_idx, filter, pad, log_ctx)) |
| @@ -235,11 +235,11 @@ static int link_filter_inouts(AVFilterContext *filter, · 3 unmodified lines | ||
| 235 | 235 | } else { |
| 236 | 236 | p->filter = filter; |
| 237 | 237 | p->pad_idx = pad; |
| 238 | − insert_inout(openInputs, p); | |
| 238 | + insert_inout(open_inputs, p); | |
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | − if(*currInputs) { | |
| 242 | + if(*curr_inputs) { | |
| 243 | 243 | av_log(log_ctx, AV_LOG_ERROR, |
| 244 | 244 | "Too many inputs specified for the \"%s\" filter.\n", |
| 245 | 245 | filter->filter->name); |
| @@ -251,14 +251,14 @@ static int link_filter_inouts(AVFilterContext *filter, · 5 unmodified lines | ||
| 251 | 251 | AVFilterInOut *currlinkn = av_mallocz(sizeof(AVFilterInOut)); |
| 252 | 252 | currlinkn->filter = filter; |
| 253 | 253 | currlinkn->pad_idx = pad; |
| 254 | − insert_inout(currInputs, currlinkn); | |
| 254 | + insert_inout(curr_inputs, currlinkn); | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | return 0; |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | −static int parse_inputs(const char **buf, AVFilterInOut **currInputs, | |
| 261 | − AVFilterInOut **openOutputs, AVClass *log_ctx) | |
| 260 | +static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs, | |
| 261 | + AVFilterInOut **open_outputs, AVClass *log_ctx) | |
| 262 | 262 | { |
| 263 | 263 | int pad = 0; |
| 264 | 264 | |
| @@ -269,8 +269,8 @@ static int parse_inputs(const char **buf, AVFilterInOut **currInputs, · 4 unmodified lines | ||
| 269 | 269 | if(!name) |
| 270 | 270 | return -1; |
| 271 | 271 | |
| 272 | − /* First check if the label is not in the openOutputs list */ | |
| 273 | − match = extract_inout(name, openOutputs); | |
| 272 | + /* First check if the label is not in the open_outputs list */ | |
| 273 | + match = extract_inout(name, open_outputs); | |
| 274 | 274 | |
| 275 | 275 | if(match) { |
| 276 | 276 | av_free(name); |
| @@ -281,7 +281,7 @@ static int parse_inputs(const char **buf, AVFilterInOut **currInputs, · 4 unmodified lines | ||
| 281 | 281 | match->pad_idx = pad; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | − insert_inout(currInputs, match); | |
| 284 | + insert_inout(curr_inputs, match); | |
| 285 | 285 | |
| 286 | 286 | *buf += consume_whitespace(*buf); |
| 287 | 287 | pad++; |
| @@ -290,9 +290,9 @@ static int parse_inputs(const char **buf, AVFilterInOut **currInputs, · 2 unmodified lines | ||
| 290 | 290 | return pad; |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | −static int parse_outputs(const char **buf, AVFilterInOut **currInputs, | |
| 294 | − AVFilterInOut **openInputs, | |
| 295 | − AVFilterInOut **openOutputs, AVClass *log_ctx) | |
| 293 | +static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs, | |
| 294 | + AVFilterInOut **open_inputs, | |
| 295 | + AVFilterInOut **open_outputs, AVClass *log_ctx) | |
| 296 | 296 | { |
| 297 | 297 | int pad = 0; |
| 298 | 298 | |
| @@ -300,14 +300,14 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs, · 1 unmodified line | ||
| 300 | 300 | char *name = parse_link_name(buf, log_ctx); |
| 301 | 301 | AVFilterInOut *match; |
| 302 | 302 | |
| 303 | − AVFilterInOut *input = *currInputs; | |
| 304 | − *currInputs = (*currInputs)->next; | |
| 303 | + AVFilterInOut *input = *curr_inputs; | |
| 304 | + *curr_inputs = (*curr_inputs)->next; | |
| 305 | 305 | |
| 306 | 306 | if(!name) |
| 307 | 307 | return -1; |
| 308 | 308 | |
| 309 | − /* First check if the label is not in the openInputs list */ | |
| 310 | − match = extract_inout(name, openInputs); | |
| 309 | + /* First check if the label is not in the open_inputs list */ | |
| 310 | + match = extract_inout(name, open_inputs); | |
| 311 | 311 | |
| 312 | 312 | if(match) { |
| 313 | 313 | if(link_filter(input->filter, input->pad_idx, |
| @@ -318,9 +318,9 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs, · 4 unmodified lines | ||
| 318 | 318 | av_free(match); |
| 319 | 319 | av_free(input); |
| 320 | 320 | } else { |
| 321 | − /* Not in the list, so add the first input as a openOutput */ | |
| 321 | + /* Not in the list, so add the first input as a open_output */ | |
| 322 | 322 | input->name = name; |
| 323 | − insert_inout(openOutputs, input); | |
| 323 | + insert_inout(open_outputs, input); | |
| 324 | 324 | } |
| 325 | 325 | *buf += consume_whitespace(*buf); |
| 326 | 326 | pad++; |
| @@ -330,19 +330,19 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs, · 3 unmodified lines | ||
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | int avfilter_parse_graph(AVFilterGraph *graph, const char *filters, |
| 333 | − AVFilterInOut *openInputs, | |
| 334 | − AVFilterInOut *openOutputs, AVClass *log_ctx) | |
| 333 | + AVFilterInOut *open_inputs, | |
| 334 | + AVFilterInOut *open_outputs, AVClass *log_ctx) | |
| 335 | 335 | { |
| 336 | 336 | int index = 0; |
| 337 | 337 | char chr = 0; |
| 338 | 338 | |
| 339 | − AVFilterInOut *currInputs = NULL; | |
| 339 | + AVFilterInOut *curr_inputs = NULL; | |
| 340 | 340 | |
| 341 | 341 | do { |
| 342 | 342 | AVFilterContext *filter; |
| 343 | 343 | filters += consume_whitespace(filters); |
| 344 | 344 | |
| 345 | − if(parse_inputs(&filters, &currInputs, &openOutputs, log_ctx) < 0) | |
| 345 | + if(parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx) < 0) | |
| 346 | 346 | goto fail; |
| 347 | 347 | |
| 348 | 348 | filter = parse_filter(&filters, graph, index, log_ctx); |
| @@ -350,24 +350,24 @@ int avfilter_parse_graph(AVFilterGraph *graph, const char *filters, · 1 unmodified line | ||
| 350 | 350 | if(!filter) |
| 351 | 351 | goto fail; |
| 352 | 352 | |
| 353 | − if(filter->input_count == 1 && !currInputs && !index) { | |
| 353 | + if(filter->input_count == 1 && !curr_inputs && !index) { | |
| 354 | 354 | /* First input can be omitted if it is "[in]" */ |
| 355 | 355 | const char *tmp = "[in]"; |
| 356 | − if(parse_inputs(&tmp, &currInputs, &openOutputs, log_ctx) < 0) | |
| 356 | + if(parse_inputs(&tmp, &curr_inputs, &open_outputs, log_ctx) < 0) | |
| 357 | 357 | goto fail; |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | − if(link_filter_inouts(filter, &currInputs, &openInputs, log_ctx) < 0) | |
| 360 | + if(link_filter_inouts(filter, &curr_inputs, &open_inputs, log_ctx) < 0) | |
| 361 | 361 | goto fail; |
| 362 | 362 | |
| 363 | − if(parse_outputs(&filters, &currInputs, &openInputs, &openOutputs, | |
| 363 | + if(parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs, | |
| 364 | 364 | log_ctx) < 0) |
| 365 | 365 | goto fail; |
| 366 | 366 | |
| 367 | 367 | filters += consume_whitespace(filters); |
| 368 | 368 | chr = *filters++; |
| 369 | 369 | |
| 370 | − if(chr == ';' && currInputs) { | |
| 370 | + if(chr == ';' && curr_inputs) { | |
| 371 | 371 | av_log(log_ctx, AV_LOG_ERROR, |
| 372 | 372 | "Could not find a output to link when parsing \"%s\"\n", |
| 373 | 373 | filters - 1); |
| @@ -376,11 +376,11 @@ int avfilter_parse_graph(AVFilterGraph *graph, const char *filters, · 2 unmodified lines | ||
| 376 | 376 | index++; |
| 377 | 377 | } while(chr == ',' || chr == ';'); |
| 378 | 378 | |
| 379 | − if(openInputs && !strcmp(openInputs->name, "out") && currInputs) { | |
| 379 | + if(open_inputs && !strcmp(open_inputs->name, "out") && curr_inputs) { | |
| 380 | 380 | /* Last output can be omitted if it is "[out]" */ |
| 381 | 381 | const char *tmp = "[out]"; |
| 382 | − if(parse_outputs(&tmp, &currInputs, &openInputs, | |
| 383 | − &openOutputs, log_ctx) < 0) | |
| 382 | + if(parse_outputs(&tmp, &curr_inputs, &open_inputs, | |
| 383 | + &open_outputs, log_ctx) < 0) | |
| 384 | 384 | goto fail; |
| 385 | 385 | } |
| 386 | 386 | |
| @@ -388,8 +388,8 @@ int avfilter_parse_graph(AVFilterGraph *graph, const char *filters, · 1 unmodified line | ||
| 388 | 388 | |
| 389 | 389 | fail: |
| 390 | 390 | avfilter_destroy_graph(graph); |
| 391 | − free_inout(openInputs); | |
| 392 | − free_inout(openOutputs); | |
| 393 | − free_inout(currInputs); | |
| 391 | + free_inout(open_inputs); | |
| 392 | + free_inout(open_outputs); | |
| 393 | + free_inout(curr_inputs); | |
| 394 | 394 | return -1; |
| 395 | 395 | } |