]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fail properly on bad decode
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 23 Jan 2012 20:53:38 +0000 (14:53 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 23 Jan 2012 20:53:38 +0000 (14:53 -0600)
src/switch_core_io.c

index c55b89186424c3093325ce0f13ccc0e02e13a2ce..01e958b2439a871d7f258749c1985d95bc3c9294 100644 (file)
@@ -863,13 +863,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                                                                                  session->write_impl.actual_samples_per_second,
                                                                                  session->raw_write_frame.data, &session->raw_write_frame.datalen, &session->raw_write_frame.rate, &frame->flags);
 
-
-
-
                if (do_resample && status == SWITCH_STATUS_SUCCESS) {
                        status = SWITCH_STATUS_RESAMPLE;
                }
-
+               
                switch (status) {
                case SWITCH_STATUS_RESAMPLE:
                        resample++;
@@ -918,11 +915,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                        status = SWITCH_STATUS_SUCCESS;
                        break;
                default:
+
                        if (status == SWITCH_STATUS_NOT_INITALIZED) {
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Codec init error!\n");
                                goto error;
                        }
-                       if (ptime_mismatch) {
+                       if (ptime_mismatch && status != SWITCH_STATUS_GENERR) {
                                status = perform_write(session, frame, flags, stream_id);
                                status = SWITCH_STATUS_SUCCESS;
                                goto error;
@@ -933,7 +931,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                        goto error;
                }
        }
-
+       
 
 
        if (session->write_resampler) {