[FFmpeg-devel] [PATCH 4/8] lavu/opt: extend AVOptionRange by second value

Lukasz Marek lukasz.m.luki2 at gmail.com
Tue Mar 25 00:37:35 CET 2014


On 24.03.2014 10:26, Nicolas George wrote:
> Le tridi 3 germinal, an CCXXII, Lukasz Marek a écrit :
>> The problem I noticed later is how to free it.
>> I added nb_components to AVOptionRanges, but this field is
>> duplicated for each component which is probably not the best.
>> If you have any other solution to solve freeing then give a hint.
>
> If you control the allocation of the AVOptionRanges (which for now seems to
> be the case as it happens only in av_opt_query_ranges_default();
> av_option_ranges_alloc(n) would be useful for later), then you can add an
> empty item at the end to mark the end of the array. Or wrap the array in a
> larger structure and use magic pointer arithmetics to find that structure
> from the array, but that is hackish.
>
> I do not think it is a sever issue though. Your current solution seems
> reasonable.

I wanted to avoid additional layers (it is complicated structure 
already) and I wanted avoid to add new API (as this would require to 
deprecate existing probably). If you have no serious remarks about it 
nor better solution, I prefer to keep it this way.
alloc function may be helpful, yes.

Thanks.



More information about the ffmpeg-devel mailing list