提交 ee72bdf0 authored 作者: Anthony Minessale's avatar Anthony Minessale

add small padding to end of mp3

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9093 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 c1ac14f1
...@@ -86,13 +86,15 @@ static inline void free_context(shout_context_t *context) ...@@ -86,13 +86,15 @@ static inline void free_context(shout_context_t *context)
if (context->fp) { if (context->fp) {
unsigned char mp3buffer[8192]; unsigned char mp3buffer[8192];
int16_t blank[1024] = {0}, *r = NULL;
int len; int len;
int16_t blank[2048] = {0}, *r = NULL;
len = lame_encode_buffer(context->gfp, blank, r, sizeof(blank) / 2, mp3buffer, sizeof(mp3buffer));
if ((len = lame_encode_buffer(context->gfp, blank, r, sizeof(blank) / 2, mp3buffer, sizeof(mp3buffer)))) { if (len) {
ret = fwrite(mp3buffer, 1, len, context->fp); ret = fwrite(mp3buffer, 1, len, context->fp);
} }
while ((len = lame_encode_flush(context->gfp, mp3buffer, sizeof(mp3buffer))) > 0) { while ((len = lame_encode_flush(context->gfp, mp3buffer, sizeof(mp3buffer))) > 0) {
ret = fwrite(mp3buffer, 1, len, context->fp); ret = fwrite(mp3buffer, 1, len, context->fp);
if (ret < 0) { if (ret < 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论