mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-06 10:26:41 +00:00
Avoid repeating ourselves in generating silence
We were handling the "send silence but not comfort noise" case in both silence_stream_file_read and switch_generate_sln_silence. This changes the former to rely on the latter.
This commit is contained in:
parent
6f11c1636b
commit
b6a10585bb
@ -93,11 +93,8 @@ static switch_status_t silence_stream_file_read(switch_file_handle_t *handle, vo
|
||||
sh->samples -= *len;
|
||||
}
|
||||
|
||||
if (sh->silence) {
|
||||
switch_generate_sln_silence((int16_t *) data, *len, sh->silence);
|
||||
} else {
|
||||
memset(data, 0, *len * 2);
|
||||
}
|
||||
switch_generate_sln_silence((int16_t *) data, *len,
|
||||
sh->silence ? sh->silence : (uint32_t)-1);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user