mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-03 17:30:37 +00:00
FS-7654 regression on eavesdropping on channels playing a file because of channel count of 0 on write frame from stream_file
This commit is contained in:
parent
71ee949431
commit
de75d9fca6
@ -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) {
|
if (switch_buffer_inuse(ep->w_buffer) >= rframe->datalen) {
|
||||||
uint32_t bytes;
|
uint32_t bytes;
|
||||||
|
int channels = rframe->channels ? rframe->channels : 1;
|
||||||
|
|
||||||
switch_buffer_lock(ep->w_buffer);
|
switch_buffer_lock(ep->w_buffer);
|
||||||
bytes = (uint32_t) switch_buffer_read(ep->w_buffer, data, rframe->datalen);
|
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;
|
rframe->samples = rframe->datalen / 2;
|
||||||
|
|
||||||
switch_buffer_unlock(ep->w_buffer);
|
switch_buffer_unlock(ep->w_buffer);
|
||||||
|
@ -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);
|
"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.rate = fh->samplerate;
|
||||||
|
write_frame.channels = fh->channels;
|
||||||
if (timer_name) {
|
if (timer_name) {
|
||||||
/* start a thread to absorb incoming audio */
|
/* start a thread to absorb incoming audio */
|
||||||
switch_core_service_session(session);
|
switch_core_service_session(session);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user