Ignore:
Timestamp:
Sep 17, 2007 3:44:47 PM (17 years ago)
Author:
bennylp
Message:

Updated pjsua_app.py Python sample application to the new changes in Python module (thanks Gideon Klompje)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/py_pjsua/py_pjsua.c

    r1430 r1438  
    24042404    unsigned  samples_per_frame; 
    24052405    unsigned  bits_per_sample; 
    2406     unsigned  listener_cnt; 
    24072406    PyListObject * listeners; 
    24082407 
     
    24442443        }         
    24452444         
    2446         self->listeners = (PyListObject *)PyList_New(PJSUA_MAX_CONF_PORTS); 
     2445        self->listeners = (PyListObject *)PyList_New(0); 
    24472446        if (self->listeners == NULL) 
    24482447        { 
     
    24882487        offsetof(PyObj_pjsua_conf_port_info, bits_per_sample), 0, 
    24892488        "Bits per sample" 
    2490     }, 
    2491     { 
    2492         "listener_cnt", T_INT,  
    2493         offsetof(PyObj_pjsua_conf_port_info, listener_cnt), 0, 
    2494         "Number of listeners in the array." 
    24952489    }, 
    24962490    { 
     
    31673161    pjsua_conf_port_info info; 
    31683162    int status;  
    3169     int i; 
     3163    unsigned i; 
    31703164 
    31713165    PJ_UNUSED_ARG(pSelf); 
     
    31833177    obj->channel_count = info.bits_per_sample; 
    31843178    obj->clock_rate = info.clock_rate; 
    3185     obj->listener_cnt = info.listener_cnt; 
    31863179    obj->name = PyString_FromStringAndSize(info.name.ptr, info.name.slen); 
    31873180    obj->samples_per_frame = info.samples_per_frame; 
    31883181    obj->slot_id = info.slot_id; 
    31893182     
    3190     for (i = 0; i < PJSUA_MAX_CONF_PORTS; i++) { 
     3183    obj->listeners = (PyListObject *)PyList_New(info.listener_cnt); 
     3184    for (i = 0; i < info.listener_cnt; i++) { 
    31913185        PyObject * item = Py_BuildValue("i",info.listeners[i]); 
    31923186        PyList_SetItem((PyObject *)obj->listeners, i, item); 
Note: See TracChangeset for help on using the changeset viewer.