2089 static PyObject *
2090 pa_stop_stream(PyObject *self, PyObject *args)
2091 {
2092
2093 int err;
2094 PyObject *stream_arg;
2095 _pyAudio_Stream *streamObject;
2096 PaStream *stream;
2097
2098 if (!PyArg_ParseTuple(args, "O!", &_pyAudio_StreamType, &stream_arg))
when PyArg_ParseTuple() succeeds
taking False path
2099 return NULL;
2100
2101 streamObject = (_pyAudio_Stream *) stream_arg;
2102
2103 if (!_is_open(streamObject)) {
when considering range: -0x80000000 <= value <= -1
taking False path
2104 PyErr_SetString(PyExc_IOError, "Stream not open");
2105 return NULL;
2106 }
2107
2108 stream = streamObject->stream;
2109
2110 Py_BEGIN_ALLOW_THREADS
releasing the GIL by calling PyEval_SaveThread()
2111 err = Pa_StopStream(stream);
2112 Py_END_ALLOW_THREADS
reacquiring the GIL by calling PyEval_RestoreThread()
2113
2114 if ((err != paNoError) && (err != paStreamIsStopped)) {
when considering range: -0x80000000 <= value <= -1
when considering range: -0x80000000 <= value <= -9984
taking True path
2115 _cleanup_Stream_object(streamObject);
2116
2117 #ifdef VERBOSE
2118 fprintf(stderr, "An error occured while using the portaudio stream\n");
2119 fprintf(stderr, "Error number: %d\n", err);
2120 fprintf(stderr, "Error message: %s\n", Pa_GetErrorText(err));
2121 #endif
2122
2123 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
2124 Py_BuildValue("(s,i)",
2125 Pa_GetErrorText(err),
2126 err));
2127 return NULL;
2128 }
2129
2130 Py_INCREF(Py_None);
2131 return Py_None;
2132 }