Choose better names for the variables in create_filter().
Originally committed as revision 16320 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
175821c631
commit
e4a5f397fd
@ -119,43 +119,43 @@ static char *parse_link_name(const char **buf, AVClass *log_ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static AVFilterContext *create_filter(AVFilterGraph *ctx, int index,
|
static AVFilterContext *create_filter(AVFilterGraph *ctx, int index,
|
||||||
const char *name, const char *args,
|
const char *filt_name, const char *args,
|
||||||
AVClass *log_ctx)
|
AVClass *log_ctx)
|
||||||
{
|
{
|
||||||
AVFilterContext *filt;
|
AVFilterContext *filt_ctx;
|
||||||
|
|
||||||
AVFilter *filterdef;
|
AVFilter *filt;
|
||||||
char inst_name[30];
|
char inst_name[30];
|
||||||
|
|
||||||
snprintf(inst_name, sizeof(inst_name), "Parsed filter %d", index);
|
snprintf(inst_name, sizeof(inst_name), "Parsed filter %d", index);
|
||||||
|
|
||||||
filterdef = avfilter_get_by_name(name);
|
filt = avfilter_get_by_name(filt_name);
|
||||||
|
|
||||||
if(!filterdef) {
|
|
||||||
av_log(log_ctx, AV_LOG_ERROR,
|
|
||||||
"no such filter: '%s'\n", name);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
filt = avfilter_open(filterdef, inst_name);
|
|
||||||
if(!filt) {
|
if(!filt) {
|
||||||
av_log(log_ctx, AV_LOG_ERROR,
|
av_log(log_ctx, AV_LOG_ERROR,
|
||||||
"error creating filter '%s'\n", name);
|
"no such filter: '%s'\n", filt_name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(avfilter_graph_add_filter(ctx, filt) < 0) {
|
filt_ctx = avfilter_open(filt, inst_name);
|
||||||
avfilter_destroy(filt);
|
if(!filt_ctx) {
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(avfilter_init_filter(filt, args, NULL)) {
|
|
||||||
av_log(log_ctx, AV_LOG_ERROR,
|
av_log(log_ctx, AV_LOG_ERROR,
|
||||||
"error initializing filter '%s' with args '%s'\n", name, args);
|
"error creating filter '%s'\n", filt_name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return filt;
|
if(avfilter_graph_add_filter(ctx, filt_ctx) < 0) {
|
||||||
|
avfilter_destroy(filt_ctx);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(avfilter_init_filter(filt_ctx, args, NULL)) {
|
||||||
|
av_log(log_ctx, AV_LOG_ERROR,
|
||||||
|
"error initializing filter '%s' with args '%s'\n", filt_name, args);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return filt_ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user