aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_filter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-05-21 22:33:13 +0200
committerAnton Khirnov <anton@khirnov.net>2023-05-31 16:15:47 +0200
commit87b576135e4b647ed5e434dd0d6acd09538f915e (patch)
tree8c6edf09736a0fe91835d5309abba8313af502ef /fftools/ffmpeg_filter.c
parentdc5864a00c7a7ebab3cc478e6abcadc231a68433 (diff)
downloadffmpeg-87b576135e4b647ed5e434dd0d6acd09538f915e.tar.gz
fftools/ffmpeg_filter: factor out binding an output stream to OutputFilter
While the new function is trivial for now, it will become more useful in future commits.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r--fftools/ffmpeg_filter.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index d74eeef52a..5f77f1e00f 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -464,6 +464,12 @@ static int ifilter_bind_ist(InputFilter *ifilter, InputStream *ist)
return 0;
}
+void ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost)
+{
+ ofilter->ost = ost;
+ av_freep(&ofilter->linklabel);
+}
+
static InputFilter *ifilter_alloc(FilterGraph *fg)
{
InputFilterPriv *ifp = allocate_array_elem(&fg->inputs, sizeof(*ifp),
@@ -624,14 +630,14 @@ int init_simple_filtergraph(InputStream *ist, OutputStream *ost,
return AVERROR(EINVAL);
}
- fg->outputs[0]->ost = ost;
-
ost->filter = fg->outputs[0];
ret = ifilter_bind_ist(fg->inputs[0], ist);
if (ret < 0)
return ret;
+ ofilter_bind_ost(fg->outputs[0], ost);
+
return 0;
}