[FFmpeg-devel] [PATCH] make av_base64_encode return something useful

Howard Chu hyc
Thu Jun 3 22:11:11 CEST 2010


Currently av_base64_encode() just returns the same pointer that was passed in 
for the output buffer. This is kind of a waste since the caller obviously 
already knows that value. Most callers of av_base64_encode() pretty much 
ignore its return value, or just check for NULL.

This patch changes it to return the pointer to the end of the result, instead 
of the head of the result. This allows callers to e.g. obtain the length of 
the result without a wasted call to strlen(), or concat new data to the string 
without having to traverse again from the beginning.

Also fixed an incorrect len passed to av_strlcat() in httpauth.c. Frankly this 
was also unnecessary since the result buffer was overallocated already.
-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: b64.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100603/cf668e33/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: b64b.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100603/cf668e33/attachment-0001.txt>



More information about the ffmpeg-devel mailing list