Commit f19463e9 authored by dmitrykos's avatar dmitrykos

wasapi: removed excessive argument checks in stream management functions

git-svn-id: https://subversion.assembla.com/svn/portaudio/portaudio/trunk@1480 0f58301d-fd10-0410-b4af-bbb618454e57
parent aa0393e4
......@@ -2263,10 +2263,6 @@ static PaError CloseStream( PaStream* s )
PaError result = paNoError;
PaWasapiStream *stream = (PaWasapiStream*)s;
// validate
if (s == NULL)
return paBadStreamPtr;
// abort active stream
if (IsStreamActive(s))
{
......@@ -2300,10 +2296,6 @@ static PaError StartStream( PaStream *s )
HRESULT hr;
PaWasapiStream *stream = (PaWasapiStream*)s;
// validate
if (s == NULL)
return paBadStreamPtr;
// check if stream is active already
if (IsStreamActive(s))
return paStreamIsNotStopped;
......@@ -2418,45 +2410,29 @@ static void _FinishStream(PaWasapiStream *stream)
// ------------------------------------------------------------------------------------------
static PaError StopStream( PaStream *s )
{
PaError result = paNoError;
// validate
if (s == NULL)
return paBadStreamPtr;
// Finish stream
_FinishStream((PaWasapiStream *)s);
return result;
return paNoError;
}
// ------------------------------------------------------------------------------------------
static PaError AbortStream( PaStream *s )
{
PaError result = paNoError;
// validate
if (s == NULL)
return paBadStreamPtr;
// Finish stream
_FinishStream((PaWasapiStream *)s);
return result;
return paNoError;
}
// ------------------------------------------------------------------------------------------
static PaError IsStreamStopped( PaStream *s )
{
PaWasapiStream *stream = (PaWasapiStream*)s;
return (stream ? !stream->running : paBadStreamPtr);
return !((PaWasapiStream *)s)->running;
}
// ------------------------------------------------------------------------------------------
static PaError IsStreamActive( PaStream *s )
{
PaWasapiStream *stream = (PaWasapiStream*)s;
return (stream ? stream->running : paBadStreamPtr);
return ((PaWasapiStream *)s)->running;
}
// ------------------------------------------------------------------------------------------
......@@ -2464,10 +2440,6 @@ static PaTime GetStreamTime( PaStream *s )
{
PaWasapiStream *stream = (PaWasapiStream*)s;
// validate
if (s == NULL)
return paBadStreamPtr;
/* suppress unused variable warnings */
(void) stream;
......@@ -2482,8 +2454,7 @@ static PaTime GetStreamTime( PaStream *s )
// ------------------------------------------------------------------------------------------
static double GetStreamCpuLoad( PaStream* s )
{
PaWasapiStream *stream = (PaWasapiStream *)s;
return (stream ? PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ) : 0.0);
return PaUtil_GetCpuLoad(&((PaWasapiStream *)s)->cpuLoadMeasurer);
}
// ------------------------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment