]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix MODFORM-6
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 5 Mar 2008 22:01:45 +0000 (22:01 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 5 Mar 2008 22:01:45 +0000 (22:01 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7798 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/formats/mod_shout/mod_shout.c

index d947d2a522667345aeaebe07b46f312ecd1dd867..46124c8c3b5d912445adbee73027c335c3e5e31b 100644 (file)
@@ -272,12 +272,13 @@ static size_t decode_fd(shout_context_t * context, void *data, size_t bytes)
                        }
 
                        if (decode_status == MP3_ERR) {
-                               if (++context->mp3err >= 20) {
+                               if (++context->mp3err >= 5) {
                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Decoder Error!\n");
+                                       goto error;
                                }
+
                                dlen = 0;
-                               //continue;
-                goto error;
+                               continue;                               
                        }
 
                        context->mp3err = 0;
@@ -586,10 +587,11 @@ static switch_status_t shout_file_open(switch_file_handle_t *handle, const char
 
         }
 
+               lame_set_brate(context->gfp, 24 * (handle->samplerate / 8000) * handle->channels);
                lame_set_num_channels(context->gfp, handle->channels);
                lame_set_in_samplerate(context->gfp, handle->samplerate);
-               lame_set_brate(context->gfp, 64);
                lame_set_out_samplerate(context->gfp, handle->samplerate);
+
         if (handle->channels == 2) {
             lame_set_mode(context->gfp, STEREO);
         } else {