From 86ce3f4f381e097df01193f5ede65316c103bab1 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sun, 14 May 2006 18:50:09 +0000 Subject: Set default sound backend in Win32 to own DirectSound, and changed conference clock to 10ms (from 20ms) git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@443 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/include/pjmedia/config.h | 3 ++- pjmedia/src/pjmedia/dsound.c | 12 +++++++++--- pjsip-apps/src/samples/siprtp_report.c | 2 +- pjsip/src/pjsua-lib/pjsua_core.c | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/pjmedia/include/pjmedia/config.h b/pjmedia/include/pjmedia/config.h index 7a71ae5f..62d27e5f 100644 --- a/pjmedia/include/pjmedia/config.h +++ b/pjmedia/include/pjmedia/config.h @@ -34,7 +34,8 @@ * by default. */ #ifndef PJMEDIA_SOUND_IMPLEMENTATION -# define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_PORTAUDIO_SOUND +//# define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_PORTAUDIO_SOUND +# define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_WIN32_DIRECT_SOUND #endif diff --git a/pjmedia/src/pjmedia/dsound.c b/pjmedia/src/pjmedia/dsound.c index e6ff8ff0..c80dbad0 100644 --- a/pjmedia/src/pjmedia/dsound.c +++ b/pjmedia/src/pjmedia/dsound.c @@ -44,7 +44,7 @@ #define BYTES_PER_SAMPLE (BITS_PER_SAMPLE/8) #define MAX_PACKET_BUFFER_COUNT 32 -#define DEFAULT_BUFFER_COUNT 5 +#define DEFAULT_BUFFER_COUNT 8 @@ -212,7 +212,10 @@ static pj_status_t init_player_stream( struct dsound_stream *ds_strm, /* Done setting up play device. */ - PJ_LOG(5,(THIS_FILE, " DirectSound player stream initialized")); + PJ_LOG(5,(THIS_FILE, + " DirectSound player stream initialized (clock_rate=%d, " + "channel_count=%d, samples_per_frame=%d", + clock_rate, channel_count, samples_per_frame)); return PJ_SUCCESS; } @@ -304,7 +307,10 @@ static pj_status_t init_capture_stream( struct dsound_stream *ds_strm, ds_strm->dwDsBufferSize = buffer_count * bytes_per_frame; /* Done setting up recorder device. */ - PJ_LOG(5,(THIS_FILE, " DirectSound capture stream initialized")); + PJ_LOG(5,(THIS_FILE, + " DirectSound capture stream initialized (clock_rate=%d, " + "channel_count=%d, samples_per_frame=%d", + clock_rate, channel_count, samples_per_frame)); return PJ_SUCCESS; } diff --git a/pjsip-apps/src/samples/siprtp_report.c b/pjsip-apps/src/samples/siprtp_report.c index dfb28301..192f223b 100644 --- a/pjsip-apps/src/samples/siprtp_report.c +++ b/pjsip-apps/src/samples/siprtp_report.c @@ -59,7 +59,7 @@ static void print_call(int call_index) pj_gettimeofday(&now); /* Print duration */ - if (inv->state >= PJSIP_INV_STATE_CONFIRMED && call->connect_time) { + if (inv->state >= PJSIP_INV_STATE_CONFIRMED && call->connect_time.sec) { PJ_TIME_VAL_SUB(now, call->connect_time); diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c index 31296dd6..eafcd78b 100644 --- a/pjsip/src/pjsua-lib/pjsua_core.c +++ b/pjsip/src/pjsua-lib/pjsua_core.c @@ -701,7 +701,7 @@ static pj_status_t init_media(void) /* Init conference bridge. */ clock_rate = pjsua.clock_rate ? pjsua.clock_rate : 16000; - samples_per_frame = clock_rate * 20 / 1000; + samples_per_frame = clock_rate * 10 / 1000; status = pjmedia_conf_create(pjsua.pool, pjsua.max_calls+PJSUA_CONF_MORE_PORTS, clock_rate, -- cgit v1.2.3