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 committed 2014-03-04 02:09:28 +00:00
1 parent 6f11c1636b
commit b6a10585bb
1 file changed
+2 -5
@@ -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;
}