aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_filter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-03-27 08:12:14 +0200
committerAnton Khirnov <anton@khirnov.net>2023-04-13 15:11:56 +0200
commitfd91ac11ed5aa2a22a02a89f8a363551a368c638 (patch)
tree3f0d08f88d8c53db6e181d02b32d88bf968bd273 /fftools/ffmpeg_filter.c
parent83da6d3f54fc85784e0ef843ee6e0c03e338722e (diff)
downloadffmpeg-fd91ac11ed5aa2a22a02a89f8a363551a368c638.tar.gz
fftools/ffmpeg: move OutputStream.last_filter_pts to OutputFilter
This value is associated with the filtergraph output rather than the output stream, so this is a more appropriate place for it.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r--fftools/ffmpeg_filter.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index c9fd65e902..f48ae83a40 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -176,6 +176,18 @@ static void choose_channel_layouts(OutputFilter *ofilter, AVBPrint *bprint)
av_bprint_chars(bprint, ':', 1);
}
+static OutputFilter *ofilter_alloc(FilterGraph *fg)
+{
+ OutputFilter *ofilter;
+
+ ofilter = ALLOC_ARRAY_ELEM(fg->outputs, fg->nb_outputs);
+ ofilter->graph = fg;
+ ofilter->format = -1;
+ ofilter->last_pts = AV_NOPTS_VALUE;
+
+ return ofilter;
+}
+
int init_simple_filtergraph(InputStream *ist, OutputStream *ost)
{
FilterGraph *fg = av_mallocz(sizeof(*fg));
@@ -186,10 +198,8 @@ int init_simple_filtergraph(InputStream *ist, OutputStream *ost)
report_and_exit(AVERROR(ENOMEM));
fg->index = nb_filtergraphs;
- ofilter = ALLOC_ARRAY_ELEM(fg->outputs, fg->nb_outputs);
- ofilter->ost = ost;
- ofilter->graph = fg;
- ofilter->format = -1;
+ ofilter = ofilter_alloc(fg);
+ ofilter->ost = ost;
ost->filter = ofilter;
@@ -502,9 +512,8 @@ int init_complex_filtergraph(FilterGraph *fg)
init_input_filter(fg, cur);
for (cur = outputs; cur;) {
- OutputFilter *const ofilter = ALLOC_ARRAY_ELEM(fg->outputs, fg->nb_outputs);
+ OutputFilter *const ofilter = ofilter_alloc(fg);
- ofilter->graph = fg;
ofilter->out_tmp = cur;
ofilter->type = avfilter_pad_get_type(cur->filter_ctx->output_pads,
cur->pad_idx);