summaryrefslogtreecommitdiffstats
path: root/audio/unix.c
diff options
context:
space:
mode:
authorBrad Midgley <bmidgley@xmission.com>2007-09-03 19:12:40 +0000
committerBrad Midgley <bmidgley@xmission.com>2007-09-03 19:12:40 +0000
commite1ca1c0fbb4694b4b2c8e7532b05dbfcd4144687 (patch)
treeaff694f72f2fb363b44df3487fbd1c51b33c6030 /audio/unix.c
parentf7ca86c9aa904a915af6720a0add59dd6148cca1 (diff)
stub in the state change ipc for pausing a stream (but don't enable it yet)
Diffstat (limited to 'audio/unix.c')
-rw-r--r--audio/unix.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/audio/unix.c b/audio/unix.c
index c39c80c4..accf6efb 100644
--- a/audio/unix.c
+++ b/audio/unix.c
@@ -637,6 +637,27 @@ static void ctl_event(struct unix_client *client,
{
}
+static int reply_state(int sock, struct ipc_packet *pkt)
+{
+ struct ipc_data_state *state = (struct ipc_data_state *) pkt->data;
+ int len;
+
+ info("status=%u", state->state);
+
+ pkt->type = PKT_TYPE_STATE_RSP;
+ pkt->length = sizeof(struct ipc_data_state);
+ pkt->error = PKT_ERROR_NONE;
+
+ len = sizeof(struct ipc_packet) + sizeof(struct ipc_data_state);
+ len = send(sock, pkt, len, 0);
+ if (len < 0)
+ error("Error %s(%d)", strerror(errno), errno);
+
+ debug("%d bytes sent", len);
+
+ return 0;
+}
+
static void state_event(struct unix_client *client,
struct ipc_packet *pkt, int len)
{
@@ -648,9 +669,9 @@ static void state_event(struct unix_client *client,
device_set_state(dev, state->state);
else
state->state = device_get_state(dev);
-
- unix_send_state(client->sock, pkt);
#endif
+
+ reply_state(client->sock, pkt);
}
static gboolean client_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
@@ -812,25 +833,3 @@ void unix_exit(void)
unix_sock = -1;
}
-#if 0
-static int unix_send_state(int sock, struct ipc_packet *pkt)
-{
- struct ipc_data_state *state = (struct ipc_data_state *) pkt->data;
- int len;
-
- info("status=%u", state->state);
-
- pkt->type = PKT_TYPE_STATE_RSP;
- pkt->length = sizeof(struct ipc_data_state);
- pkt->error = PKT_ERROR_NONE;
-
- len = sizeof(struct ipc_packet) + sizeof(struct ipc_data_state);
- len = send(sock, pkt, len, 0);
- if (len < 0)
- error("Error %s(%d)", strerror(errno), errno);
-
- debug("%d bytes sent", len);
-
- return 0;
-}
-#endif