Ignore:
Timestamp:
Mar 20, 2013 6:56:19 AM (6 years ago)
Author:
nanang
Message:

Misc (re #1630): Added compile-time setting to configure audio switchboard buffer size.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/conf_switch.c

    r4122 r4443  
    5151#define SLOT_TYPE           unsigned 
    5252#define INVALID_SLOT        ((SLOT_TYPE)-1) 
    53 #define BUFFER_SIZE         PJMEDIA_MAX_MTU 
     53#define BUFFER_SIZE         PJMEDIA_CONF_SWITCH_BOARD_BUF_SIZE 
    5454#define MAX_LEVEL           (32767) 
    5555#define MIN_LEVEL           (-32768) 
     
    144144 
    145145    PJ_ASSERT_RETURN(pool && conf && port && name && p_conf_port, PJ_EINVAL); 
     146 
     147    /* Check port's buffer size */ 
     148    if (port->info.fmt.id == PJMEDIA_FORMAT_PCM && 
     149        PJMEDIA_PIA_SPF(&port->info)*2 > BUFFER_SIZE - sizeof(pjmedia_frame)) 
     150    { 
     151        pj_assert(!"Too small buffer size for audio switchboard. " 
     152                   "Try increase PJMEDIA_CONF_SWITCH_BOARD_BUF_SIZE"); 
     153        return PJ_ETOOSMALL; 
     154    } 
    146155 
    147156    /* Create port. */ 
Note: See TracChangeset for help on using the changeset viewer.