From: Paul Brossier Date: Thu, 5 Nov 2009 23:41:39 +0000 (+0100) Subject: py-cvec.c: cvec.length to return the actual length X-Git-Tag: bzr2git~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eb93592edfd07e0b698ad1508066f94152fe8df9;p=aubio.git py-cvec.c: cvec.length to return the actual length --- diff --git a/interfaces/python/py-cvec.c b/interfaces/python/py-cvec.c index 63904bc0..18e386d7 100644 --- a/interfaces/python/py-cvec.c +++ b/interfaces/python/py-cvec.c @@ -28,7 +28,7 @@ Py_cvec_new (PyTypeObject * type, PyObject * args, PyObject * kwds) self = (Py_cvec *) type->tp_alloc (type, 0); - self->length = Py_default_vector_length; + self->length = Py_default_vector_length / 2 + 1; self->channels = Py_default_vector_channels; if (self == NULL) { @@ -36,7 +36,7 @@ Py_cvec_new (PyTypeObject * type, PyObject * args, PyObject * kwds) } if (length > 0) { - self->length = length; + self->length = length / 2 + 1; } else if (length < 0) { PyErr_SetString (PyExc_ValueError, "can not use negative number of elements"); @@ -57,7 +57,7 @@ Py_cvec_new (PyTypeObject * type, PyObject * args, PyObject * kwds) static int Py_cvec_init (Py_cvec * self, PyObject * args, PyObject * kwds) { - self->o = new_cvec (self->length, self->channels); + self->o = new_cvec ((self->length - 1) * 2, self->channels); if (self->o == NULL) { return -1; }