[FFmpeg-devel] [PATCH] id3v2enc: chapter support

Paul B Mahol onemda at gmail.com
Fri May 10 20:39:48 CEST 2013


On 5/10/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Fri, May 10, 2013 at 06:15:37PM +0000, Paul B Mahol wrote:
>> On 5/10/13, Michael Niedermayer <michaelni at gmx.at> wrote:
>> > On Thu, May 09, 2013 at 04:26:49PM +0000, Paul B Mahol wrote:
>> >> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> >> ---
>> >>  libavformat/id3v2enc.c | 84
>> >> ++++++++++++++++++++++++++++++++++++++++++--------
>> >>  1 file changed, 71 insertions(+), 13 deletions(-)
>> >>
>>
>> [...]
>>
>> >
>> > char name[123] would be simpler, not needing the error check and free
>>
>> I really do not see how that would by any simpler...
>
> maybe iam missing something but
>
> +    name = av_asprintf("ch%d", id);
> +    if (!name) {
> +        av_free(dyn_buf);
> +        return AVERROR(ENOMEM);
> +    }
> [...]
> +    id3->len += avio_put_str(dyn_bc, name);
> [...]
> +    av_free(name);
>
> vs.
> just
>
> snprintf(name, 122, "ch%d", id);
> id3->len += avio_put_str(dyn_bc, name);

ok.


More information about the ffmpeg-devel mailing list