2178 static PyObject *
2179 pa_is_stream_stopped(PyObject *self, PyObject *args)
2180 {
2181 int err;
2182 PyObject *stream_arg;
2183 _pyAudio_Stream *streamObject;
2184 PaStream *stream;
2185
2186 if (!PyArg_ParseTuple(args, "O!", &_pyAudio_StreamType, &stream_arg))
when PyArg_ParseTuple() succeeds
taking False path
2187 return NULL;
2188
2189 streamObject = (_pyAudio_Stream *) stream_arg;
2190
2191 if (!_is_open(streamObject)) {
when considering range: -0x80000000 <= value <= -1
taking False path
2192 PyErr_SetObject(PyExc_IOError,
2193 Py_BuildValue("(s,i)",
2194 "Stream closed",
2195 paBadStreamPtr));
2196 return NULL;
2197 }
2198
2199 stream = streamObject->stream;
2200
2201 if ((err = Pa_IsStreamStopped(stream)) < 0) {
when considering range: -0x80000000 <= value <= -1
taking True path
2202 _cleanup_Stream_object(streamObject);
2203
2204 #ifdef VERBOSE
2205 fprintf(stderr, "An error occured while using the portaudio stream\n");
2206 fprintf(stderr, "Error number: %d\n", err);
2207 fprintf(stderr, "Error message: %s\n", Pa_GetErrorText(err));
2208 #endif
2209
2210 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
2211 Py_BuildValue("(s,i)",
2212 Pa_GetErrorText(err),
2213 err));
2214 return NULL;
2215 }
2216
2217 if (err) {
2218 Py_INCREF(Py_True);
2219 return Py_True;
2220 }
2221
2222 Py_INCREF(Py_False);
2223 return Py_False;
2224 }