[FFmpeg-devel] [PATCH] Add writing of vorbis comments to flac files
Justin Ruggles
justin.ruggles
Thu Oct 22 04:28:06 CEST 2009
Justin Ruggles wrote:
> James Darnley wrote:
>
>> Updated patch attached.
>>
>>>> + p = p0;
>>>> +
>>>> + bytestream_put_byte(&p, last_block?0x84:0x04);
>>>> + bytestream_put_be24(&p, len);
>>>> + ff_vorbis_comment_write(&p, m, vendor);
>>>> +
>>>> + put_buffer(pb, p0, len+4);
>>>> + av_freep(p0);
>>>> + p = NULL;
>>> setting p to NULL is pointless here.
>>>
>> True, but I recall it being good practice to set pointers to null when freed.
>
> it is already done for you.
> from libavutil/mem.c:
> void av_freep(void *arg)
> {
> void **ptr= (void**)arg;
> av_free(*ptr);
> *ptr = NULL;
> }
nevermind on that one. I didn't notice the p vs. p0. It's fine how you
have it.
-Justin
More information about the ffmpeg-devel
mailing list