[FFmpeg-devel] [RFC] AVDictionary2

Leo Izen leo.izen at gmail.com
Wed Apr 9 03:00:20 EEST 2025


On 4/8/25 06:19, Michael Niedermayer wrote:
> Hi all
> 
> As i have too many things to do already i did the most logic thing and
> started thinking about a new and unrelated idea.
> 
> This is a list of problems and ideas, that everyone is welcome to add to and
> comment on.
> 
> AVDictionary is just bad.
> 
> * its complicated internally with
>    unneeded alternative (AV_DICT_DONT_STRDUP_VAL/KEY) these are rarely used
>    and probably not relevant for performance.
> 

As far as I'm aware the main purpose of AV_DICT_DONT_STRDUP is to 
transfer ownership to the dictionary to save a call to malloc/free. If I 
construct a string e.g. with av_bprint API, and then I want to pass it 
as a value to an AVDictionary *, then without access to 
AV_DICT_DONT_STRDUP_VAL as an option, I will then have to free it.

Since your goal is to avoid malloc/free calls I feel like this is a 
reasonable interface to continue to support.

- Leo Izen (Traneptora)



More information about the ffmpeg-devel mailing list