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

Nicolas George george at nsup.org
Wed Sep 9 18:29:42 EEST 2020


Andreas Rheinhardt (12020-09-09):
> 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.

It can be used to do that, but a filter that uses it is doing something
very wrong. But in the meantime, ff_inlink_check_available_samples() is
doing exactly what it is supposed to do, i.e. predict that
ff_inlink_consume_samples() will succeed.

I do not want to "close loopholes" because we are not in an adversarial
situation.

> 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.

Then it is easy: the filter should consume the samples on its input, if
there are none try to acknowledge the status change: if the status has
changed, the input is finished. Checking beforehand is quite
unnecessary.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200909/0d0e1bd6/attachment.sig>


More information about the ffmpeg-devel mailing list