Instead of calling the input filter request_frame() method,
ff_request_frame() now marks the link and returns immediately.
buffersink is changed to activate the marked filters until
a frame is obtained.
This field is used for fast comparison between link ages,
it is in AV_TIME_BASE units, in other words microseconds,
µs =~ us.
Renaming it allows a second field in link time base units.
Commit bf0d2d6030 introduced
av_warn_unused_result to avfilter/formats, whose associated warnings
were mostly fixed in 6aaac24d72. This
fixes the issues in avfilter/avfiltergraph.
Tested with FATE.
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Many of the functions from avfilter/formats can return errors, usually AVERROR(ENOMEM).
This propagates the return values.
All of these were found by using av_warn_unused_result, demonstrating its utility.
Tested with FATE. I am least sure of the changes to avfilter/filtergraph,
since I don't know what/how reduce_format is intended to behave and how it should
react to errors.
Fixes: CID 1325680, 1325679, 1325678.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Previous version Reviewed-by: Nicolas George <george@nsup.org>
Previous version Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
When merging the formats around the automatically inserted
convert filters, the refcount of the format lists can not be 0.
Coverity does not detect it, and suspects a memory leak,
because if refcount is 0 the newly allocated lists are not
stored anywhere. That gives CIDs 1224282, 1224283 and 1224284.
Lists with refcount 0 are used in can_merge_formats(), so the
asserts can not be moved inside the merge functions.
Define positive return values as non errors and leave further meaning undefined
This allows future extensions to use these values
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This prevents the unneeded insertion of multiple aresample filters in some cases
The format merging is moved to avoid having to call the channel layout
merge twice. The channel layout merge code uses different structures and
is not compatible with the added dry run wrappers.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Prior to this it was possible that format reduction was ended
before it fully propagated leading to failure later in picking
formats.
No testcase with unmodified source exists, the case was reproduced
with less aggressive list merging though.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
query_formats() returning EAGAIN is not considered a progress
in the format negotiation.
If the filter returns EAGAIN but did set some of its formats
lists, it could be considered a partial success and counted
as progress in the negotiation. Not counting it is not a
problem because it currently only happens in the first round,
where there will always be some progress on the other filters.
Since this function adds a standalone filter to a filter graph and we do
not support creating such filters, there is no reason for this function
to exist.
Since we do not support "standalone" filters not attached to an
AVFilterGraph, we should not have a public function to create such
filters. In addition that function is horribly named, the action it does
cannot be possibly described as "opening" a filter.
As far as I can tell the code should not change behaviour
depending on locale in any of these places.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
The following commit:
b97d61f avfilter/ff_merge_formats: only merge if doing so does not loose chroma or alpha
introduced an exception to avoid lossy conversions.
Add a comment to explain the logic.
Fix the call to avoid applying it on audio formats.