History

Make avfilter_insert_filter() propagate an error code in case the called avfilter_link() fails.

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

Stefano Sabatini committed 16 years ago

Commit db9dfa31 parent 4ecf1531 file · +3 −2Browse files

Unified · Split

libavfilter/avfilter.c+3−2
@@ -124,6 +124,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, · 123 unmodified lines
124int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,124int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
125 unsigned in, unsigned out)125 unsigned in, unsigned out)
126{126{
127 int ret;
127 unsigned dstpad_idx = link->dstpad - link->dst->input_pads;128 unsigned dstpad_idx = link->dstpad - link->dst->input_pads;
128 129
129 av_log(link->dst, AV_LOG_INFO, "auto-inserting filter '%s' "130 av_log(link->dst, AV_LOG_INFO, "auto-inserting filter '%s' "
@@ -131,10 +132,10 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, · 1 unmodified line
131 filt->name, link->src->name, link->dst->name);132 filt->name, link->src->name, link->dst->name);
132 133
133 link->dst->inputs[dstpad_idx] = NULL;134 link->dst->inputs[dstpad_idx] = NULL;
134 if (avfilter_link(filt, out, link->dst, dstpad_idx)) {135 if ((ret = avfilter_link(filt, out, link->dst, dstpad_idx)) < 0) {
135 /* failed to link output filter to new filter */136 /* failed to link output filter to new filter */
136 link->dst->inputs[dstpad_idx] = link;137 link->dst->inputs[dstpad_idx] = link;
137 return -1;138 return ret;
138 }139 }
139 140
140 /* re-hookup the link to the new destination filter we inserted */141 /* re-hookup the link to the new destination filter we inserted */

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