Make link_filter_inouts() return meaningful error codes.
Originally committed as revision 25693 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -194,7 +194,7 @@ static int link_filter_inouts(AVFilterContext *filter,
|
|||||||
AVFilterInOut **curr_inputs,
|
AVFilterInOut **curr_inputs,
|
||||||
AVFilterInOut **open_inputs, AVClass *log_ctx)
|
AVFilterInOut **open_inputs, AVClass *log_ctx)
|
||||||
{
|
{
|
||||||
int pad = filter->input_count;
|
int pad = filter->input_count, ret;
|
||||||
|
|
||||||
while (pad--) {
|
while (pad--) {
|
||||||
AVFilterInOut *p = *curr_inputs;
|
AVFilterInOut *p = *curr_inputs;
|
||||||
@@ -202,14 +202,14 @@ static int link_filter_inouts(AVFilterContext *filter,
|
|||||||
av_log(log_ctx, AV_LOG_ERROR,
|
av_log(log_ctx, AV_LOG_ERROR,
|
||||||
"Not enough inputs specified for the \"%s\" filter.\n",
|
"Not enough inputs specified for the \"%s\" filter.\n",
|
||||||
filter->filter->name);
|
filter->filter->name);
|
||||||
return -1;
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
*curr_inputs = (*curr_inputs)->next;
|
*curr_inputs = (*curr_inputs)->next;
|
||||||
|
|
||||||
if (p->filter) {
|
if (p->filter) {
|
||||||
if (link_filter(p->filter, p->pad_idx, filter, pad, log_ctx))
|
if ((ret = link_filter(p->filter, p->pad_idx, filter, pad, log_ctx)) < 0)
|
||||||
return -1;
|
return ret;
|
||||||
av_free(p->name);
|
av_free(p->name);
|
||||||
av_free(p);
|
av_free(p);
|
||||||
} else {
|
} else {
|
||||||
@@ -223,7 +223,7 @@ static int link_filter_inouts(AVFilterContext *filter,
|
|||||||
av_log(log_ctx, AV_LOG_ERROR,
|
av_log(log_ctx, AV_LOG_ERROR,
|
||||||
"Too many inputs specified for the \"%s\" filter.\n",
|
"Too many inputs specified for the \"%s\" filter.\n",
|
||||||
filter->filter->name);
|
filter->filter->name);
|
||||||
return -1;
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
pad = filter->output_count;
|
pad = filter->output_count;
|
||||||
|
Reference in New Issue
Block a user