diff --git a/pjmedia/include/pjmedia-audiodev/config.h b/pjmedia/include/pjmedia-audiodev/config.h index 2c5a1d65be..240115ad3a 100644 --- a/pjmedia/include/pjmedia-audiodev/config.h +++ b/pjmedia/include/pjmedia-audiodev/config.h @@ -41,6 +41,15 @@ PJ_BEGIN_DECL * @{ */ +/** + * This setting controls the maximum number of supported audio devices. + * + * Default: 64 + */ +#ifndef PJMEDIA_AUD_DEV_MAX_DEVS +# define PJMEDIA_AUD_DEV_MAX_DEVS 64 +#endif + /** * This setting controls the buffer length of audio device name. * diff --git a/pjmedia/include/pjmedia/audiodev.h b/pjmedia/include/pjmedia/audiodev.h index 7f74bfc7b8..7aed566663 100644 --- a/pjmedia/include/pjmedia/audiodev.h +++ b/pjmedia/include/pjmedia/audiodev.h @@ -79,7 +79,6 @@ typedef pj_int32_t pjmedia_aud_dev_index; #define PJMEDIA_AUD_INVALID_DEV -3 #define PJMEDIA_AUD_MAX_DRIVERS 16 -#define PJMEDIA_AUD_MAX_DEVS 64 /** Forward declaration for pjmedia_aud_stream */ @@ -117,7 +116,7 @@ typedef struct pjmedia_aud_subsys pjmedia_aud_driver drv[PJMEDIA_AUD_MAX_DRIVERS];/* Array of drivers. */ unsigned dev_cnt; /* Total number of devices. */ - pj_uint32_t dev_list[PJMEDIA_AUD_MAX_DEVS];/* Array of dev IDs. */ + pj_uint32_t dev_list[PJMEDIA_AUD_DEV_MAX_DEVS];/* Array dev IDs.*/ } pjmedia_aud_subsys; diff --git a/pjmedia/src/pjmedia-audiodev/alsa_dev.c b/pjmedia/src/pjmedia-audiodev/alsa_dev.c index 1d80d5ec2f..f326c13f5e 100755 --- a/pjmedia/src/pjmedia-audiodev/alsa_dev.c +++ b/pjmedia/src/pjmedia-audiodev/alsa_dev.c @@ -43,7 +43,7 @@ #define ALSASOUND_CAPTURE 2 #define MAX_SOUND_CARDS 5 #define MAX_SOUND_DEVICES_PER_CARD 5 -#define MAX_DEVICES PJMEDIA_AUD_MAX_DEVS +#define MAX_DEVICES PJMEDIA_AUD_DEV_MAX_DEVS #define MAX_MIX_NAME_LEN 64 /* Set to 1 to enable tracing */ diff --git a/pjmedia/src/pjmedia/audiodev.c b/pjmedia/src/pjmedia/audiodev.c index eea7dfe0d5..24e4e48e66 100644 --- a/pjmedia/src/pjmedia/audiodev.c +++ b/pjmedia/src/pjmedia/audiodev.c @@ -103,12 +103,12 @@ PJ_DEF(pj_status_t) pjmedia_aud_driver_init(unsigned drv_idx, /* Get number of devices */ dev_cnt = f->op->get_dev_count(f); - if (dev_cnt + aud_subsys.dev_cnt > PJMEDIA_AUD_MAX_DEVS) { + if (dev_cnt + aud_subsys.dev_cnt > PJMEDIA_AUD_DEV_MAX_DEVS) { PJ_LOG(4,(THIS_FILE, "%d device(s) cannot be registered because" " there are too many devices", aud_subsys.dev_cnt + dev_cnt - - PJMEDIA_AUD_MAX_DEVS)); - dev_cnt = PJMEDIA_AUD_MAX_DEVS - aud_subsys.dev_cnt; + PJMEDIA_AUD_DEV_MAX_DEVS)); + dev_cnt = PJMEDIA_AUD_DEV_MAX_DEVS - aud_subsys.dev_cnt; } /* enabling this will cause pjsua-lib initialization to fail when there