aboutsummaryrefslogtreecommitdiffstats
path: root/src/timer.c
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2007-06-12 17:58:17 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2007-06-12 17:58:17 +0000
commit3c5cecb828cdf9618cd4ec14a15f8cc59e313db8 (patch)
tree3033dc925c58c25effc82faa6cb6f4d471efaa9f /src/timer.c
parentbd0620ff72247603a0feef286b03bd98082f69fb (diff)
downloadmpd-3c5cecb828cdf9618cd4ec14a15f8cc59e313db8.tar.gz
mpd-3c5cecb828cdf9618cd4ec14a15f8cc59e313db8.tar.xz
mpd-3c5cecb828cdf9618cd4ec14a15f8cc59e313db8.zip
Redoing remiss's shout patch. This time, just block on open() instead of
pretending to play while we wait for the connection to timeout. This removes the need for timers, and thus removes the now unnecessary timer_get_runtime_* function(s) from the timer code. The changes made compared to the pre-patch shout plugin are: * Block while connecting, timing out after 2 seconds. * Close the device, and not just the connection, if play returns -1. * Remove sd->last_err (it's always assigned before use). * Some minor cleanups. git-svn-id: https://svn.musicpd.org/mpd/trunk@6555 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/timer.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/timer.c b/src/timer.c
index f9dfb1ab6..0406a945e 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -51,7 +51,7 @@ void timer_free(Timer *timer)
void timer_start(Timer *timer)
{
- timer->start_time = timer->time = now();
+ timer->time = now();
timer->started = 1;
}
@@ -59,7 +59,6 @@ void timer_reset(Timer *timer)
{
timer->time = 0;
timer->started = 0;
- timer->start_time = 0;
}
void timer_add(Timer *timer, int size)
@@ -79,8 +78,3 @@ void timer_sync(Timer *timer)
if (sleep > 0)
my_usleep(sleep);
}
-
-uint64_t timer_get_runtime_us(Timer *timer)
-{
- return now() - timer->start_time;
-}