summaryrefslogtreecommitdiffstats
path: root/src/oss.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-27 03:55:47 +0200
committerLennart Poettering <lennart@poettering.net>2009-08-27 03:55:47 +0200
commit54d8b7b31e3fbcbe80e20d0aef2bc344d44db81e (patch)
treeb6386ac633a6bb88509591a54935ecb91ba0e779 /src/oss.c
parenta030f162722d5172be86eb6691d61baffe981b54 (diff)
implement ca_context_playing() call
Diffstat (limited to 'src/oss.c')
-rw-r--r--src/oss.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/oss.c b/src/oss.c
index 6135780..eebc2f8 100644
--- a/src/oss.c
+++ b/src/oss.c
@@ -499,3 +499,32 @@ int driver_cancel(ca_context *c, uint32_t id) {
return CA_SUCCESS;
}
+
+int driver_playing(ca_context *c, uint32_t id, int *playing) {
+ struct private *p;
+ struct outstanding *out;
+
+ ca_return_val_if_fail(c, CA_ERROR_INVALID);
+ ca_return_val_if_fail(c->private, CA_ERROR_STATE);
+ ca_return_val_if_fail(playing, CA_ERROR_INVALID);
+
+ p = PRIVATE(c);
+
+ *playing = 0;
+
+ ca_mutex_lock(p->outstanding_mutex);
+
+ for (out = p->outstanding; out; out = out->next) {
+
+ if (out->dead ||
+ out->id != id)
+ continue;
+
+ *playing = 1;
+ break;
+ }
+
+ ca_mutex_unlock(p->outstanding_mutex);
+
+ return CA_SUCCESS;
+}