diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-05-28 14:55:22 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-05-28 14:55:22 +0000 |
commit | e92fc1e1389daa666961bedb4aecefdd4334c391 (patch) | |
tree | ec0ff46948b7e53fce793d7ee090016b41ba3bf0 | |
parent | 954805cf0f35e7c1ac6c10392ed777f6cf1848a8 (diff) |
Sound device id zero mean autoselect device
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@481 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjmedia/src/pjmedia/conference.c | 12 | ||||
-rw-r--r-- | pjmedia/src/pjmedia/pasound.c | 8 |
2 files changed, 16 insertions, 4 deletions
diff --git a/pjmedia/src/pjmedia/conference.c b/pjmedia/src/pjmedia/conference.c index 0897d4ae..6dd1b66e 100644 --- a/pjmedia/src/pjmedia/conference.c +++ b/pjmedia/src/pjmedia/conference.c @@ -192,6 +192,7 @@ static pj_status_t put_frame(pjmedia_port *this_port, const pjmedia_frame *frame); static pj_status_t get_frame(pjmedia_port *this_port, pjmedia_frame *frame); +static pj_status_t destroy_port(pjmedia_port *this_port); /* @@ -454,6 +455,7 @@ PJ_DEF(pj_status_t) pjmedia_conf_create( pj_pool_t *pool, conf->master_port->get_frame = &get_frame; conf->master_port->put_frame = &put_frame; + conf->master_port->on_destroy = &destroy_port; conf->master_port->user_data = conf; @@ -535,6 +537,16 @@ PJ_DEF(pj_status_t) pjmedia_conf_destroy( pjmedia_conf *conf ) /* + * Destroy the master port (will destroy the conference) + */ +static pj_status_t destroy_port(pjmedia_port *this_port) +{ + pjmedia_conf *conf = this_port->user_data; + return pjmedia_conf_destroy(conf); +} + + +/* * Get port zero interface. */ PJ_DEF(pjmedia_port*) pjmedia_conf_get_master_port(pjmedia_conf *conf) diff --git a/pjmedia/src/pjmedia/pasound.c b/pjmedia/src/pjmedia/pasound.c index c019c258..d4ed700a 100644 --- a/pjmedia/src/pjmedia/pasound.c +++ b/pjmedia/src/pjmedia/pasound.c @@ -243,7 +243,7 @@ PJ_DEF(pj_status_t) pjmedia_snd_open_rec( int index, unsigned paFrames; PaError err; - if (index == -1) { + if (index <= 0) { int count = Pa_GetDeviceCount(); for (index=0; index<count; ++index) { paDevInfo = Pa_GetDeviceInfo(index); @@ -336,7 +336,7 @@ PJ_DEF(pj_status_t) pjmedia_snd_open_player( int index, unsigned paFrames; PaError err; - if (index == -1) { + if (index <= 0) { int count = Pa_GetDeviceCount(); for (index=0; index<count; ++index) { paDevInfo = Pa_GetDeviceInfo(index); @@ -438,7 +438,7 @@ PJ_DEF(pj_status_t) pjmedia_snd_open( int rec_id, unsigned paFrames; PaError err; - if (rec_id == -1) { + if (rec_id <= 0) { int count = Pa_GetDeviceCount(); for (rec_id=0; rec_id<count; ++rec_id) { paRecDevInfo = Pa_GetDeviceInfo(rec_id); @@ -457,7 +457,7 @@ PJ_DEF(pj_status_t) pjmedia_snd_open( int rec_id, } } - if (play_id == -1) { + if (play_id <= 0) { int count = Pa_GetDeviceCount(); for (play_id=0; play_id<count; ++play_id) { paPlayDevInfo = Pa_GetDeviceInfo(play_id); |