aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_filter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-07-13 15:11:07 +0200
committerAnton Khirnov <anton@khirnov.net>2023-07-20 20:30:13 +0200
commitab16e324eae9f0eded14f8486fe44ad97ef613c8 (patch)
tree1e7834773130c0e6690f703ab77c0970152b77b6 /fftools/ffmpeg_filter.c
parent6298dd683b8542dd0c6b5eefabdcd8a7c7c54399 (diff)
downloadffmpeg-ab16e324eae9f0eded14f8486fe44ad97ef613c8.tar.gz
fftools/ffmpeg_filter: return error codes from ofilter_bind_ost() instead of aborting
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r--fftools/ffmpeg_filter.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index d373d8c002..cdf5610620 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -624,7 +624,7 @@ static void set_channel_layout(OutputFilterPriv *f, OutputStream *ost)
av_channel_layout_default(&f->ch_layout, ost->enc_ctx->ch_layout.nb_channels);
}
-void ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost)
+int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost)
{
OutputFilterPriv *ofp = ofp_from_ofilter(ofilter);
FilterGraph *fg = ofilter->graph;
@@ -699,15 +699,17 @@ void ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost)
for (int i = 0; i < fg->nb_outputs; i++)
if (!fg->outputs[i]->ost)
- return;
+ return 0;
ret = configure_filtergraph(fg);
if (ret < 0) {
av_log(fg, AV_LOG_ERROR, "Error configuring filter graph: %s\n",
av_err2str(ret));
- exit_program(1);
+ return ret;
}
}
+
+ return 0;
}
static InputFilter *ifilter_alloc(FilterGraph *fg)
@@ -899,7 +901,9 @@ int init_simple_filtergraph(InputStream *ist, OutputStream *ost,
if (ret < 0)
return ret;
- ofilter_bind_ost(fg->outputs[0], ost);
+ ret = ofilter_bind_ost(fg->outputs[0], ost);
+ if (ret < 0)
+ return ret;
return 0;
}