[FFmpeg-devel] [PATCH] add md5 muxer

Baptiste Coudurier baptiste.coudurier
Tue May 25 08:36:46 CEST 2010


On 5/23/10 4:31 PM, Reimar D?ffinger wrote:
> On Sun, May 23, 2010 at 03:30:10PM -0700, Baptiste Coudurier wrote:
>>> +static void md5_finish(struct AVFormatContext *s, char *buf)
>>> +{
>>> +    uint8_t md5[16];
>>> +    int i, offset = strlen(buf);
>>> +    av_md5_final(s->priv_data, md5);
>>> +    for (i = 0; i<   sizeof(md5); i++) {
>>> +        snprintf(buf + offset, 3, "%02"PRIx8, md5[i]);
>>> +        offset += 2;
>>> +    }
>>> +    buf[offset] = '\n';
>>> +    buf[offset+1] = 0;
>>
>> Nitpick, but you can put_buffer(s->pb, "\n", 1);
>
> Haven't checked if it makes a difference within the framework,
> but I'd prefer it if the whole data was done with a single write,
> can give nicer output if it is written to stdout in a multithreaded
> environment.

This is irrelevant considering put_buffer is buffered.

[...]

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list