2226 static PyObject *
2227 pa_is_stream_active(PyObject *self, PyObject *args)
2228 {
2229
2230 int err;
2231 PyObject *stream_arg;
2232 _pyAudio_Stream *streamObject;
2233 PaStream *stream;
2234
2235 if (!PyArg_ParseTuple(args, "O!", &_pyAudio_StreamType, &stream_arg))
when PyArg_ParseTuple() succeeds
taking False path
2236 return NULL;
2237
2238 streamObject = (_pyAudio_Stream *) stream_arg;
2239
2240 if (!_is_open(streamObject)) {
when considering range: -0x80000000 <= value <= -1
taking False path
2241 PyErr_SetString(PyExc_IOError, "Stream not open");
2242 return NULL;
2243 }
2244
2245 stream = streamObject->stream;
2246
2247 if ((err = Pa_IsStreamActive(stream)) < 0) {
when considering range: -0x80000000 <= value <= -1
taking True path
2248 _cleanup_Stream_object(streamObject);
2249
2250 #ifdef VERBOSE
2251 fprintf(stderr, "An error occured while using the portaudio stream\n");
2252 fprintf(stderr, "Error number: %d\n", err);
2253 fprintf(stderr, "Error message: %s\n", Pa_GetErrorText(err));
2254 #endif
2255
2256 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
2257 Py_BuildValue("(s,i)",
2258 Pa_GetErrorText(err),
2259 err));
2260 return NULL;
2261 }
2262
2263 if (err) {
2264 Py_INCREF(Py_True);
2265 return Py_True;
2266 }
2267
2268 Py_INCREF(Py_False);
2269 return Py_False;
2270 }