mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
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
This commit is contained in:
parent
4ecf1539bf
commit
db9dfa3cc3
@ -124,6 +124,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
|
|||||||
int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
|
int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
|
||||||
unsigned in, unsigned out)
|
unsigned in, unsigned out)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
unsigned dstpad_idx = link->dstpad - link->dst->input_pads;
|
unsigned dstpad_idx = link->dstpad - link->dst->input_pads;
|
||||||
|
|
||||||
av_log(link->dst, AV_LOG_INFO, "auto-inserting filter '%s' "
|
av_log(link->dst, AV_LOG_INFO, "auto-inserting filter '%s' "
|
||||||
@ -131,10 +132,10 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
|
|||||||
filt->name, link->src->name, link->dst->name);
|
filt->name, link->src->name, link->dst->name);
|
||||||
|
|
||||||
link->dst->inputs[dstpad_idx] = NULL;
|
link->dst->inputs[dstpad_idx] = NULL;
|
||||||
if (avfilter_link(filt, out, link->dst, dstpad_idx)) {
|
if ((ret = avfilter_link(filt, out, link->dst, dstpad_idx)) < 0) {
|
||||||
/* failed to link output filter to new filter */
|
/* failed to link output filter to new filter */
|
||||||
link->dst->inputs[dstpad_idx] = link;
|
link->dst->inputs[dstpad_idx] = link;
|
||||||
return -1;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* re-hookup the link to the new destination filter we inserted */
|
/* re-hookup the link to the new destination filter we inserted */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user