summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/polypmixerctrl.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/polypmixerctrl.c b/src/polypmixerctrl.c
index 42cea8a..a219bd9 100644
--- a/src/polypmixerctrl.c
+++ b/src/polypmixerctrl.c
@@ -371,26 +371,6 @@ static void gst_polypmixer_ctrl_timeout_event(pa_mainloop_api *a, pa_time_event
c->time_event = NULL;
}
-static struct timeval* gst_polypmixer_ctrl_elapse(struct timeval *tv, unsigned msec) {
- unsigned long secs;
-
- gettimeofday(tv, NULL);
-
- secs = (msec/1000);
- tv->tv_sec += (unsigned long) secs;
- msec -= secs*1000;
-
- tv->tv_usec += msec*1000;
-
- /* Normalize */
- while (tv->tv_usec >= 1000000) {
- tv->tv_sec++;
- tv->tv_usec -= 1000000;
- }
-
- return tv;
-}
-
void gst_polypmixer_ctrl_set_volume(GstPolypMixerCtrl *c, GstMixerTrack *track, gint *volumes) {
pa_cvolume v;
int i;
@@ -413,7 +393,7 @@ void gst_polypmixer_ctrl_set_volume(GstPolypMixerCtrl *c, GstMixerTrack *track,
* to update the volume only once every 100ms */
struct timeval tv;
pa_mainloop_api *api = pa_threaded_mainloop_get_api(c->mainloop);
- c->time_event = api->time_new(api, gst_polypmixer_ctrl_elapse(&tv, 100), gst_polypmixer_ctrl_timeout_event, c);
+ c->time_event = api->time_new(api, pa_timeval_add(pa_gettimeofday(&tv), 100000), gst_polypmixer_ctrl_timeout_event, c);
}
pa_threaded_mainloop_unlock(c->mainloop);