aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2012-08-16 18:46:40 +1200
committerMatthew Gregan <[email protected]>2012-08-16 18:46:40 +1200
commit2d7d3e8f2ecabb70d2723f3c86fcb591a84b7f85 (patch)
treea5bd9b5bddbde85f46901b2d3cdf61f7f36a6777
parentbd65f80c8ef9e56d9cfabf2e125d420bc926bc97 (diff)
downloadcubeb-2d7d3e8f2ecabb70d2723f3c86fcb591a84b7f85.tar.gz
cubeb-2d7d3e8f2ecabb70d2723f3c86fcb591a84b7f85.zip
alsa: error out of cubeb_stream_start when stream is in an invalid state.
-rw-r--r--src/cubeb_alsa.c4
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);