[FFmpeg-devel] [PATCH] avcodec: parse options from AVCodec.bsfs

James Almer jamrial at gmail.com
Fri Jul 20 00:45:23 EEST 2018


On 7/19/2018 6:16 PM, Carl Eugen Hoyos wrote:
> 2018-07-19 21:47 GMT+02:00, James Almer <jamrial at gmail.com>:
>> On 7/19/2018 4:31 PM, Nicolas George wrote:
>>> James Almer (2018-07-19):
>>>> This is more in line with the similar error above. Aborting gracefully
>>>> by printing a message and returning an error value instead of a hard
>>>> abort() with no explanation as to why "ret == AVERROR(ENOMEM)" was
>>>> expected.
>>>
>>> Explaining to whom? If it is a consistency bug within lavc, notifying
>>> the user is worthless, the correct thing to do is to prevent the
>>> inconsistency from getting committed, hence assert and FATE test.
>>>
>>> Regards,
>>
>> AVOptions available in bitstream filters, or even the range of accepted
>> values, may depend on configure time options (external or internal
>> dependencies). A simple ./configure could enable all that's needed for
>> the option to be available as required by the decoder auto inserting the
>> bsf, but ./configure --disable-everything --enable-decoder=foo may not.
> 
> Then I believe BUG is not the correct error value as users are allowed
> not to enable all features.
> 
> Carl Eugen

We're talking about dependencies pulled in by components. mlp_decoder
needs mlp_parser, so if the former is enabled then the latter will be
automatically enabled as well as per the configure rules. The user can't
forcefully disable the latter in that case as the decoder depends on it,
either to build or to run.
vp9_decoder needs vp9_superframe_split_bsf, and the same thing happens.
If you could disable the latter, the decoder would not work. The
earlier, older AVERROR_BUG in the function would be triggered in that
case, because it means there's a missing dependency in configure.

With AVOptions the same logic applies. If some bsf option needs a
certain module so a value may become available, and a decoder
autoinserts that bsf setting that value for the option in question, then
that module becomes a dependency for the decoder that needs to be set in
configure.

When normally a missing dependency results in build time failures
because some object wasn't compiled, in here it results in run time
failures because a call to function failed in a way it was not supposed to.


More information about the ffmpeg-devel mailing list