mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 16:15:04 +00:00
cleanup and formating
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@261 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
900c08571b
commit
bedcabb8ec
@ -122,7 +122,3 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
|
||||
/* indicate that the module should continue to be loaded */
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -30,7 +30,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define HAVE_APR
|
||||
#include <switch.h>
|
||||
#include <jrtp4c.h>
|
||||
|
@ -95,40 +95,6 @@ static switch_status switch_raw_destroy(switch_codec *codec)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#if 0
|
||||
switch_status raw_file_open(switch_file_handle *handle, char *path)
|
||||
{
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
switch_status raw_file_close(switch_file_handle *handle)
|
||||
{
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
switch_status raw_file_seek(switch_file_handle *handle, unsigned int *cur_sample, unsigned int samples, int whence)
|
||||
{
|
||||
return SWITCH_STATUS_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
/* Registration */
|
||||
|
||||
|
||||
static char *supported_formats[] = {"raw", "r8k", NULL};
|
||||
|
||||
static const switch_file_interface raw_file_interface = {
|
||||
/*.interface_name*/ "raw",
|
||||
/*.file_open*/ raw_file_open,
|
||||
/*.file_close*/ raw_file_close,
|
||||
/*.file_read*/ NULL,
|
||||
/*.file_write*/ NULL,
|
||||
/*.file_seek*/ raw_file_seek,
|
||||
/*.extens*/ supported_formats,
|
||||
/*.next*/ NULL,
|
||||
};
|
||||
#endif
|
||||
|
||||
static const switch_codec_implementation raw_32k_implementation = {
|
||||
/*.samples_per_second = */ 32000,
|
||||
/*.bits_per_second = */ 512000,
|
||||
|
@ -150,7 +150,7 @@ struct private_object {
|
||||
struct woomera_profile *profile;
|
||||
char dest[WOOMERA_STRLEN];
|
||||
int port;
|
||||
struct timeval started;
|
||||
switch_time_t started;
|
||||
int timeout;
|
||||
char dtmfbuf[WOOMERA_STRLEN];
|
||||
switch_caller_profile *caller_profile;
|
||||
|
@ -72,21 +72,16 @@ SWITCH_DECLARE(switch_status) switch_socket_create_pollfd(switch_pollfd_t *poll,
|
||||
switch_pollset_t *pollset;
|
||||
switch_status status;
|
||||
|
||||
|
||||
if ((status = switch_pollset_create(&pollset, 1, pool, flags)) != SWITCH_STATUS_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
poll->desc_type = SWITCH_POLL_SOCKET;
|
||||
poll->reqevents = flags;
|
||||
poll->desc.s = sock;
|
||||
poll->client_data = sock;
|
||||
|
||||
return switch_pollset_add(pollset, poll);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -102,54 +97,6 @@ SWITCH_DECLARE(int) switch_socket_waitfor(switch_pollfd_t *poll, int ms)
|
||||
return nsds;
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_TIMEVAL_STRUCT
|
||||
#define ONE_MILLION 1000000
|
||||
/*
|
||||
* put timeval in a valid range. usec is 0..999999
|
||||
* negative values are not allowed and truncated.
|
||||
*/
|
||||
static struct timeval tvfix(struct timeval a)
|
||||
{
|
||||
if (a.tv_usec >= ONE_MILLION) {
|
||||
a.tv_sec += a.tv_usec % ONE_MILLION;
|
||||
a.tv_usec %= ONE_MILLION;
|
||||
} else if (a.tv_usec < 0) {
|
||||
a.tv_usec = 0;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
struct timeval switch_tvadd(struct timeval a, struct timeval b)
|
||||
{
|
||||
/* consistency checks to guarantee usec in 0..999999 */
|
||||
a = tvfix(a);
|
||||
b = tvfix(b);
|
||||
a.tv_sec += b.tv_sec;
|
||||
a.tv_usec += b.tv_usec;
|
||||
if (a.tv_usec >= ONE_MILLION) {
|
||||
a.tv_sec++;
|
||||
a.tv_usec -= ONE_MILLION;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
struct timeval switch_tvsub(struct timeval a, struct timeval b)
|
||||
{
|
||||
/* consistency checks to guarantee usec in 0..999999 */
|
||||
a = tvfix(a);
|
||||
b = tvfix(b);
|
||||
a.tv_sec -= b.tv_sec;
|
||||
a.tv_usec -= b.tv_usec;
|
||||
if (a.tv_usec < 0) {
|
||||
a.tv_sec-- ;
|
||||
a.tv_usec += ONE_MILLION;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
#undef ONE_MILLION
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
//this forces certain symbols to not be optimized out of the dll
|
||||
void include_me(void)
|
||||
|
Loading…
x
Reference in New Issue
Block a user