diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-09-17 15:44:47 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-09-17 15:44:47 +0000 |
commit | 0b5b5d6d0b9e0c0362c15126bd74176aa1ce5161 (patch) | |
tree | f825c13c0f498430911d4312b5df6a90970f5ebf /pjsip-apps/src/py_pjsua/py_pjsua.c | |
parent | 256d36fb49a1aebcea8d63dbb65f3597ddc2cb3c (diff) |
Updated pjsua_app.py Python sample application to the new changes in Python module (thanks Gideon Klompje)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1438 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/py_pjsua/py_pjsua.c')
-rw-r--r-- | pjsip-apps/src/py_pjsua/py_pjsua.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/pjsip-apps/src/py_pjsua/py_pjsua.c b/pjsip-apps/src/py_pjsua/py_pjsua.c index 021bd742..b1abbdad 100644 --- a/pjsip-apps/src/py_pjsua/py_pjsua.c +++ b/pjsip-apps/src/py_pjsua/py_pjsua.c @@ -2403,7 +2403,6 @@ typedef struct unsigned channel_count; unsigned samples_per_frame; unsigned bits_per_sample; - unsigned listener_cnt; PyListObject * listeners; } PyObj_pjsua_conf_port_info; @@ -2443,7 +2442,7 @@ static PyObject * conf_port_info_new(PyTypeObject *type, PyObject *args, return NULL; } - self->listeners = (PyListObject *)PyList_New(PJSUA_MAX_CONF_PORTS); + self->listeners = (PyListObject *)PyList_New(0); if (self->listeners == NULL) { Py_DECREF(self); @@ -2489,11 +2488,6 @@ static PyMemberDef conf_port_info_members[] = "Bits per sample" }, { - "listener_cnt", T_INT, - offsetof(PyObj_pjsua_conf_port_info, listener_cnt), 0, - "Number of listeners in the array." - }, - { "listeners", T_OBJECT_EX, offsetof(PyObj_pjsua_conf_port_info, listeners), 0, "Array of listeners (in other words, ports where this port " @@ -3166,7 +3160,7 @@ static PyObject *py_pjsua_conf_get_port_info PyObj_pjsua_conf_port_info * obj; pjsua_conf_port_info info; int status; - int i; + unsigned i; PJ_UNUSED_ARG(pSelf); @@ -3182,12 +3176,12 @@ static PyObject *py_pjsua_conf_get_port_info obj->bits_per_sample = info.bits_per_sample; obj->channel_count = info.bits_per_sample; obj->clock_rate = info.clock_rate; - obj->listener_cnt = info.listener_cnt; obj->name = PyString_FromStringAndSize(info.name.ptr, info.name.slen); obj->samples_per_frame = info.samples_per_frame; obj->slot_id = info.slot_id; - for (i = 0; i < PJSUA_MAX_CONF_PORTS; i++) { + obj->listeners = (PyListObject *)PyList_New(info.listener_cnt); + for (i = 0; i < info.listener_cnt; i++) { PyObject * item = Py_BuildValue("i",info.listeners[i]); PyList_SetItem((PyObject *)obj->listeners, i, item); } |