[FFmpeg-devel] [PATCH 03/25] avfilter/af_headphone: Check for the existence of samples

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Wed Sep 9 18:18:20 EEST 2020


Nicolas George:
> Andreas Rheinhardt (12020-09-09):
>> How should one then check whether an input is finished? Check for
>> ff_inlink_check_available_samples(ctx->inputs[i],
>> ff_inlink_queued_samples(ctx->inputs[i]) + 1) being 1?
> 
> No, these tell you what can be obtained immediately.
> 

The documentation of ff_inlink_check_available_samples() contains the
note "on EOF and error, min becomes 1". Which means that
ff_inlink_check_available_samples() can be used to peek into the error
code of this inlink by setting min so high that the not enough samples
can be available. You seem to want to forbid it absolutely that a filter
knows whether there will be more data forthcoming after the data that is
already queued, so I am surprised that you have not also closed this
loophole in your patch just now.

> The test for a finished input is ff_inlink_acknowledge_status().
> 
> The need for this test is probably the sign of a flawed logic: the
> filter is trying to anticipate things when it should just be organized
> to do as necessary.
> 
For this filter to work it is necessary to know whether all inputs
except input 0 are finished; it can only start when they are finished.

- Andreas


More information about the ffmpeg-devel mailing list