summaryrefslogtreecommitdiffstats
path: root/audio/headset.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-11-14 17:27:16 -0300
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-11-17 14:15:10 -0300
commit7ec871d37de442fd3731a0eef319851c61fb04cc (patch)
tree069d1732958ede55f6e1821f653f1c6039e22c9c /audio/headset.c
parent204180c7dc2e20b9b701275a3fefb52707720f54 (diff)
Make use of g_timeout_add_seconds whenever possible.
Diffstat (limited to 'audio/headset.c')
-rw-r--r--audio/headset.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/audio/headset.c b/audio/headset.c
index c7428aac..039d627a 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -62,9 +62,9 @@
#include "../src/adapter.h"
#include "../src/device.h"
-#define DC_TIMEOUT 3000
+#define DC_TIMEOUT 3
-#define RING_INTERVAL 3000
+#define RING_INTERVAL 3
#define BUF_SIZE 1024
@@ -551,7 +551,8 @@ static void sco_connect_cb(GIOChannel *chan, int err, const bdaddr_t *src,
if (hs->pending_ring) {
ring_timer_cb(NULL);
- ag.ring_timer = g_timeout_add(RING_INTERVAL, ring_timer_cb,
+ ag.ring_timer = g_timeout_add_seconds(RING_INTERVAL,
+ ring_timer_cb,
NULL);
hs->pending_ring = FALSE;
}
@@ -1529,7 +1530,8 @@ static DBusMessage *hs_ring(DBusConnection *conn, DBusMessage *msg,
}
ring_timer_cb(NULL);
- ag.ring_timer = g_timeout_add(RING_INTERVAL, ring_timer_cb, NULL);
+ ag.ring_timer = g_timeout_add_seconds(RING_INTERVAL, ring_timer_cb,
+ NULL);
done:
return reply;
@@ -2087,7 +2089,7 @@ gboolean headset_cancel_stream(struct audio_device *dev, unsigned int id)
if (hs->auto_dc) {
if (hs->rfcomm)
- hs->dc_timer = g_timeout_add(DC_TIMEOUT,
+ hs->dc_timer = g_timeout_add_seconds(DC_TIMEOUT,
(GSourceFunc) hs_dc_timeout,
dev);
else
@@ -2171,7 +2173,8 @@ int headset_connect_sco(struct audio_device *dev, GIOChannel *io)
if (hs->pending_ring) {
ring_timer_cb(NULL);
- ag.ring_timer = g_timeout_add(RING_INTERVAL, ring_timer_cb,
+ ag.ring_timer = g_timeout_add_seconds(RING_INTERVAL,
+ ring_timer_cb,
NULL);
hs->pending_ring = FALSE;
}
@@ -2354,7 +2357,7 @@ gboolean headset_unlock(struct audio_device *dev, headset_lock_t lock)
if (hs->auto_dc) {
if (hs->state == HEADSET_STATE_CONNECTED)
- hs->dc_timer = g_timeout_add(DC_TIMEOUT,
+ hs->dc_timer = g_timeout_add_seconds(DC_TIMEOUT,
(GSourceFunc) hs_dc_timeout,
dev);
else
@@ -2455,7 +2458,8 @@ int telephony_incoming_call_ind(const char *number, int type)
}
ring_timer_cb(NULL);
- ag.ring_timer = g_timeout_add(RING_INTERVAL, ring_timer_cb, NULL);
+ ag.ring_timer = g_timeout_add_seconds(RING_INTERVAL, ring_timer_cb,
+ NULL);
return 0;
}