[FFmpeg-devel] [PATCH v17 1/5] libavutil: Add wchartoutf8(), wchartoansi(), utf8toansi() and getenv_utf8()

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Mon Jun 20 03:54:23 EEST 2022


nil-admirari at mailo.com:
>> This forces allocations and frees in scenarios where this is wholly
>> unnecessary. This can be avoided by adding a custom deallocator for
>> strings returned via getenv_utf8: Namely a define/wrapper around av_free
>> in the _WIN32 and a no-op else.
> 
> Done: https://ffmpeg.org/pipermail/ffmpeg-devel/2022-June/297804.html
> 

Thanks for this.

> Note, however, that the introduction of freeenv_utf8()
> doubles allocations and deallocations in vf_frei0r.c on Windows:
> https://ffmpeg.org/pipermail/ffmpeg-devel/2022-June/297802.html
> 
> These additional memory operations can be avoided only with a whole bunch
> of new #ifdef _WIN32 and #if HAVE_GETENV, which haven't been done.
> 

Or any reuses the #ifs from getenv_utf8.h.
https://github.com/mkver/FFmpeg/commits/getenv contains a version that
does this.

- Andreas


More information about the ffmpeg-devel mailing list