]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7654 regression on eavesdropping on channels playing a file because of channel...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 22 Jul 2015 05:29:36 +0000 (00:29 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 22 Jul 2015 05:29:36 +0000 (00:29 -0500)
src/switch_ivr_async.c
src/switch_ivr_play_say.c

index 11b816b811362f6462a441cbbeec49a19b655042..134335ea60efe26d8994f974eea8051aff7a1a3f 100644 (file)
@@ -1627,10 +1627,12 @@ static switch_bool_t eavesdrop_callback(switch_media_bug_t *bug, void *user_data
 
                                if (switch_buffer_inuse(ep->w_buffer) >= rframe->datalen) {
                                        uint32_t bytes;
+                                       int channels = rframe->channels ? rframe->channels : 1;
+
                                        switch_buffer_lock(ep->w_buffer);
                                        bytes = (uint32_t) switch_buffer_read(ep->w_buffer, data, rframe->datalen);
 
-                                       rframe->datalen = switch_merge_sln(rframe->data, rframe->samples, (int16_t *) data, bytes / 2, rframe->channels) * 2 * rframe->channels;
+                                       rframe->datalen = switch_merge_sln(rframe->data, rframe->samples, (int16_t *) data, bytes / 2, channels) * 2 * channels;
                                        rframe->samples = rframe->datalen / 2;
 
                                        switch_buffer_unlock(ep->w_buffer);
index eda1d6ef01a75ed7609f54b66947572cd99a1878..347dfcab5fad4172a70b2f973fb8abe771b2f378 100644 (file)
@@ -1380,7 +1380,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
                                                          "Setup timer success %u bytes per %d ms! %d ch\n", len, interval, codec.implementation->number_of_channels);
                }
                write_frame.rate = fh->samplerate;
-
+               write_frame.channels = fh->channels;
                if (timer_name) {
                        /* start a thread to absorb incoming audio */
                        switch_core_service_session(session);