[FFmpeg-devel] Questions about av_base64_encode()

Michael Niedermayer michaelni
Mon Oct 29 17:36:02 CET 2007


Hi

On Mon, Oct 29, 2007 at 03:59:00PM +0100, Luca Abeni wrote:
> Hi all,
> 
> I am trying to use base64 encoding from libavutil, so I looked
> at av_base64_encode() and I have two questions about it:
> 1) Why isn't the "uint8_t * src" marked as "const"?
>     Would it be ok to change the function's prototype in
>     char *av_base64_encode(char * buf, int buf_len, const uint8_t * src, int len)
>     ?

probably ok


> 2) av_base64_encode() fails if buf_len < len * 4 / 3 + 12...
>     Why "+12"? Shouldn't it be "+4", or "+5" (considering the
>     0 to terminate the string)? Or am I missing something?

dunno, also i dunno why the
if(len) is there it seems redundant

feel free to simplify it

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Thouse who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071029/7fe80ff9/attachment.pgp>



More information about the ffmpeg-devel mailing list