1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-10-06 05:47:18 +02:00

fftools/ffmpeg_sched: close stream when sch_filter_send receives EOF

THis is currently done by sch_demux_send() (via demux_stream_send_to_dst()),
sch_enc_send() (via enc_send_to_dst()), and sch_dec_send() (via
dec_send_to_dst()), but not by sch_filter_send().

Implement the same queue-closing logic for them. The main benefit here is that
this will allow them to mark downstream inputs as send-done (in addition
to received-done), which is useful for a following commit.
This commit is contained in:
Niklas Haas
2025-09-09 13:10:53 +02:00
parent 56d9ca69d7
commit d43fd5b332

View File

@@ -2492,6 +2492,7 @@ int sch_filter_send(Scheduler *sch, unsigned fg_idx, unsigned out_idx, AVFrame *
{
SchFilterGraph *fg;
SchedulerNode dst;
int ret;
av_assert0(fg_idx < sch->nb_filters);
fg = &sch->filters[fg_idx];
@@ -2499,9 +2500,16 @@ int sch_filter_send(Scheduler *sch, unsigned fg_idx, unsigned out_idx, AVFrame *
av_assert0(out_idx < fg->nb_outputs);
dst = fg->outputs[out_idx].dst;
return (dst.type == SCH_NODE_TYPE_ENC) ?
send_to_enc (sch, &sch->enc[dst.idx], frame) :
send_to_filter(sch, &sch->filters[dst.idx], dst.idx_stream, frame);
if (dst.type == SCH_NODE_TYPE_ENC) {
ret = send_to_enc(sch, &sch->enc[dst.idx], frame);
if (ret == AVERROR_EOF)
send_to_enc(sch, &sch->enc[dst.idx], NULL);
} else {
ret = send_to_filter(sch, &sch->filters[dst.idx], dst.idx_stream, frame);
if (ret == AVERROR_EOF)
send_to_filter(sch, &sch->filters[dst.idx], dst.idx_stream, NULL);
}
return ret;
}
static int filter_done(Scheduler *sch, unsigned fg_idx)