[FFmpeg-devel] [PATCH] avfillter/buffersrc: activate and EOF fix

Paul B Mahol onemda at gmail.com
Fri Nov 3 22:47:02 EET 2023


On Fri, Nov 3, 2023 at 8:04 PM Nicolas George <george at nsup.org> wrote:

> Tristan Matthews (12023-11-02):
> > Just to confirm that I can reproduce JEEB's test, before the patches:
>
> Just to be clear: I never doubted that Paul's patches do make the bug go
> away in your test case. That would imply accusing Paul of lying about
> simple technical facts, that would be both stupid and uncivil.
>
> What you need to understand is that is barely relevant: “I churned the
> code a lot and now the bug does not happen in my test case” is not an
> acceptable way of leading development.
>
> What Paul needs to provide (or you, or anybody else; no idea who “JEEB”
> is) is a proof that the changes are both correct and necessary.
>
> Correct: you need to prove that this bug is fixed in all cases, not just
> the one you were testing on.
>
> Necessary: you need to establish that the bug cannot be fixed with fewer
> changes, because each change is chance for introducing a new bug.
>
> Such a proof would certainly start with with an analysis of how the bug
> gets triggered by the current code.
>
> The “necessary” point is especially important: it is a well-established
> principle that filters with no more than one input and one output do not
> need to use the activate framework directly (and therefore should not,
> as it makes the code more complex).
>
> If Paul thinks he found an exception to that well-established law, he
> needs to present strong evidence.
>
> But if no such exception exist (which is the most likely: the law is
> true), then it is entirely possible that what Paul found is a bug in the
> code that implements the activate mechanism for simple filters. And in
> that case, we need to fix that bug.
>
> Or maybe the actual problem is somewhere in the fftools an error check
> is skipped.
>
> We need to know what is happening before any fix can be devised. We need
> an analysis of the bug. Any effort going into this that is not first
> analyzing what is going on is a waste of time.
>

What an triptych of text for such simple concepts, Homer and Tolstoy would
be embarrassed.

Introduction of .activate API introduced checking for explicit EOF from
both direction in filter processing,
the next filter in filtergraph, and for filter previous of current filter
in filtergraph.
buffersrc filter patch for switching to activate adds explicit code to
check for EOF reached in forward (relative to buffersrc filter) direction
of filtergraph processing.
I'm not aware that buffersrc ever checked for such cases even in era before
.activate API was introduced.

By simply adding printf into buffersrc filter code or adding showinfo
filter between buffersrc and next filter (relative from buffersrc filter)
one can find out that buffersrc ignores
EOF and keeps pushing frames to next filters in filtergraph that reached
EOF status.

Also I think that forward and/or backward EOF direction status checking is
not correctly handled at all for any filters not using .activate(), and I'm
not aware that it was ever working correctly in all cases.


>
> Regards,
>
> --
>   Nicolas George
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-devel mailing list