[FFmpeg-devel] [PATCH 3/3] base64: simplify end handling in av_base64_encode()
Michael Niedermayer
michaelni at gmx.at
Fri Jan 20 22:57:20 CET 2012
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
libavutil/base64.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/libavutil/base64.c b/libavutil/base64.c
index 80ab44b..7b58c53 100644
--- a/libavutil/base64.c
+++ b/libavutil/base64.c
@@ -97,13 +97,11 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size)
bytes_remaining--;
i_shift += 8;
- do {
- *dst++ = b64[(i_bits << 6 >> i_shift) & 0x3f];
- i_shift -= 6;
- } while (i_shift > 6);
}
- if (i_shift > 0)
+ while (i_shift > 0) {
*dst++ = b64[(i_bits << 6 >> i_shift) & 0x3f];
+ i_shift -= 6;
+ }
while ((dst - ret) & 3)
*dst++ = '=';
*dst = '\0';
--
1.7.5.4
More information about the ffmpeg-devel
mailing list