[FFmpeg-devel] [PATCH 2/4] lavu/opt: document av_opt_copy function

Lukasz Marek lukasz.m.luki2 at gmail.com
Sun Nov 9 17:10:10 CET 2014


On 09.11.2014 07:15, wm4 wrote:
> On Sat,  8 Nov 2014 18:13:51 +0100
> Lukasz Marek <lukasz.m.luki2 at gmail.com> wrote:
>
>> ---
>>   libavutil/opt.h | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/libavutil/opt.h b/libavutil/opt.h
>> index b9ac932..b78810c 100644
>> --- a/libavutil/opt.h
>> +++ b/libavutil/opt.h
>> @@ -815,6 +815,16 @@ void av_opt_freep_ranges(AVOptionRanges **ranges);
>>    */
>>   int av_opt_query_ranges(AVOptionRanges **, void *obj, const char *key, int flags);
>>
>> +/**
>> + * Copy options from src object into dest object.
>> + *
>> + * Options that require memory allocation (e.g. string or binary) are malloc'ed in dest object.
>
>
>> + * Original memory is freed unless both src and dest options points to the same memory.
>
> What?? It frees dest? Or src? Does it leave dangling pointers or
> something? You must be clear about this.
>
> Guessing about it, I'd assume this means options in dest are freed
> before they are overwritten with the copied data.

Better now? Commented sentence is a continuation of the previous one so 
it is quite clear for me what to expect, but I made it more explicit.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavu-opt-document-av_opt_copy-function.patch
Type: text/x-patch
Size: 1026 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141109/ef2e6e9d/attachment.bin>


More information about the ffmpeg-devel mailing list