comparison libtheoraenc.c @ 11825:c6db7667e39b libavcodec

Use AV_BASE64_SIZE() macro
author hyc
date Fri, 04 Jun 2010 01:15:41 +0000
parents 7dd2a45249a9
children fdafbcef52f5
comparison
equal deleted inserted replaced
11824:9f3522743348 11825:c6db7667e39b
99 h->stats = av_fast_realloc(h->stats, &h->stats_size, 99 h->stats = av_fast_realloc(h->stats, &h->stats_size,
100 h->stats_offset + bytes); 100 h->stats_offset + bytes);
101 memcpy(h->stats + h->stats_offset, buf, bytes); 101 memcpy(h->stats + h->stats_offset, buf, bytes);
102 h->stats_offset += bytes; 102 h->stats_offset += bytes;
103 } else { 103 } else {
104 int b64_size = ((h->stats_offset + 2) / 3) * 4 + 1; 104 int b64_size = AV_BASE64_SIZE(h->stats_offset);
105 // libtheora generates a summary header at the end 105 // libtheora generates a summary header at the end
106 memcpy(h->stats, buf, bytes); 106 memcpy(h->stats, buf, bytes);
107 avctx->stats_out = av_malloc(b64_size); 107 avctx->stats_out = av_malloc(b64_size);
108 av_base64_encode(avctx->stats_out, b64_size, h->stats, h->stats_offset); 108 av_base64_encode(avctx->stats_out, b64_size, h->stats, h->stats_offset);
109 } 109 }