diff options
author | Matthew Gregan <[email protected]> | 2012-08-16 18:46:40 +1200 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2012-08-16 18:46:40 +1200 |
commit | 2d7d3e8f2ecabb70d2723f3c86fcb591a84b7f85 (patch) | |
tree | a5bd9b5bddbde85f46901b2d3cdf61f7f36a6777 /src | |
parent | bd65f80c8ef9e56d9cfabf2e125d420bc926bc97 (diff) | |
download | cubeb-2d7d3e8f2ecabb70d2723f3c86fcb591a84b7f85.tar.gz cubeb-2d7d3e8f2ecabb70d2723f3c86fcb591a84b7f85.zip |
alsa: error out of cubeb_stream_start when stream is in an invalid state.
Diffstat (limited to 'src')
-rw-r--r-- | src/cubeb_alsa.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cubeb_alsa.c b/src/cubeb_alsa.c index 278c706..63528b4 100644 --- a/src/cubeb_alsa.c +++ b/src/cubeb_alsa.c @@ -731,6 +731,10 @@ cubeb_stream_start(cubeb_stream * stm) pthread_mutex_unlock(&stm->mutex); pthread_mutex_lock(&ctx->mutex); + if (stm->state != INACTIVE) { + pthread_mutex_unlock(&ctx->mutex); + return CUBEB_ERROR; + } cubeb_set_stream_state(stm, RUNNING); pthread_mutex_unlock(&ctx->mutex); |