Changeset 1438 for pjproject/trunk/pjsip-apps/src/py_pjsua/py_pjsua.c
- Timestamp:
- Sep 17, 2007 3:44:47 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/py_pjsua/py_pjsua.c
r1430 r1438 2404 2404 unsigned samples_per_frame; 2405 2405 unsigned bits_per_sample; 2406 unsigned listener_cnt;2407 2406 PyListObject * listeners; 2408 2407 … … 2444 2443 } 2445 2444 2446 self->listeners = (PyListObject *)PyList_New( PJSUA_MAX_CONF_PORTS);2445 self->listeners = (PyListObject *)PyList_New(0); 2447 2446 if (self->listeners == NULL) 2448 2447 { … … 2488 2487 offsetof(PyObj_pjsua_conf_port_info, bits_per_sample), 0, 2489 2488 "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."2495 2489 }, 2496 2490 { … … 3167 3161 pjsua_conf_port_info info; 3168 3162 int status; 3169 inti;3163 unsigned i; 3170 3164 3171 3165 PJ_UNUSED_ARG(pSelf); … … 3183 3177 obj->channel_count = info.bits_per_sample; 3184 3178 obj->clock_rate = info.clock_rate; 3185 obj->listener_cnt = info.listener_cnt;3186 3179 obj->name = PyString_FromStringAndSize(info.name.ptr, info.name.slen); 3187 3180 obj->samples_per_frame = info.samples_per_frame; 3188 3181 obj->slot_id = info.slot_id; 3189 3182 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++) { 3191 3185 PyObject * item = Py_BuildValue("i",info.listeners[i]); 3192 3186 PyList_SetItem((PyObject *)obj->listeners, i, item);
Note: See TracChangeset
for help on using the changeset viewer.