2272 static PyObject *
2273 pa_get_stream_time(PyObject *self, PyObject *args)
2274 {
2275 double time;
2276 PyObject *stream_arg;
2277 _pyAudio_Stream *streamObject;
2278 PaStream *stream;
2279
2280 if (!PyArg_ParseTuple(args, "O!", &_pyAudio_StreamType, &stream_arg))
when PyArg_ParseTuple() succeeds
taking False path
2281 return NULL;
2282
2283 streamObject = (_pyAudio_Stream *) stream_arg;
2284
2285 if (!_is_open(streamObject)) {
when considering range: -0x80000000 <= value <= -1
taking False path
2286 PyErr_SetObject(PyExc_IOError,
2287 Py_BuildValue("(s,i)",
2288 "Stream closed",
2289 paBadStreamPtr));
2290 return NULL;
2291 }
2292
2293 stream = streamObject->stream;
2294
2295 if ((time = Pa_GetStreamTime(stream)) == 0) {
when taking True path
2296 _cleanup_Stream_object(streamObject);
2297 PyErr_SetObject(PyExc_IOError,
when Py_BuildValue() succeeds
calling PyErr_SetObject()
new ref from call to Py_BuildValue was allocated at: PyErr_SetObject(PyExc_IOError,
ob_refcnt is now refs: 1 owned
ob_refcnt is now refs: 1 owned, 1 borrowed
2298 Py_BuildValue("(s,i)",
2299 "Internal Error",
2300 paInternalError));
2301 return NULL;
2302 }
2303
2304 return PyFloat_FromDouble(time);
2305 }