]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add small padding to end of mp3
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 18 Jul 2008 17:51:01 +0000 (17:51 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 18 Jul 2008 17:51:01 +0000 (17:51 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9093 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/formats/mod_shout/mod_shout.c

index fa9f2e691bd01b94898c4285feb963e5f53ec887..ff8ff12c46fdc40ceb08f06ea46b065695f507e4 100644 (file)
@@ -86,13 +86,15 @@ static inline void free_context(shout_context_t *context)
 
                if (context->fp) {
                        unsigned char mp3buffer[8192];
-                       int16_t blank[1024] = {0}, *r = NULL;
                        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);
                        }
-                       
+
                        while ((len = lame_encode_flush(context->gfp, mp3buffer, sizeof(mp3buffer))) > 0) {
                                ret = fwrite(mp3buffer, 1, len, context->fp);
                                if (ret < 0) {