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:
Travis Cross 2014-03-03 20:03:22 +00:00
parent 6f11c1636b
commit b6a10585bb

View File

@ -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;
}