Anton Khirnov:
> Quoting Andreas Rheinhardt (2023-10-20 16:00:45)
>> Anton Khirnov:
>>> Quoting Andreas Rheinhardt (2023-07-03 20:02:25)
>>>> Marvin Scholz:
>>>>> I honestly can't think of a sensible API design for this,
>>>>> if you have any idea feel free to share.
>>>>>
>>>>
>>>> The only way I can think of that allows this is for the user to pass a
>>>> pointer to a (const) AVDictionaryEntry, namely the entry that the user
>>>> wishes to pop. This is of course cumbersome, because it would be two
>>>> function calls.
>>>
>>> We could start guaranteeing that entries with the same key are always
>>> returned in insertion order. Now that I think of it there's some code in
>>> ffmpeg CLI that relies on that.
>>>
>>
>> IIRC this is not true correctly, because removing an entry changes the
>> order of the remaining entries (we don't memmove the remaining entries
>> into the new position; instead we move the last entry to the now vacant
>> slot).
> 
> I am aware - that code is strictly speaking incorrect. It happens to
> work because nothing ever gets removed from the option dicts. We could
> consider changing the internal representation somehow, so that all
> values for a key are grouped together.
> 

We could also just memmove the remaining entries.

- Andreas

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to