diff options
author | Denis Krjuchkov <denis@crazydev.net> | 2013-05-12 19:03:42 +0600 |
---|---|---|
committer | Denis Krjuchkov <denis@crazydev.net> | 2013-05-12 19:03:42 +0600 |
commit | 49a3845135142ada6d581d5a6f4a5192aaed49be (patch) | |
tree | 67dd709c03fb8cc18377ad74d09da512a217f42a /src/output/HttpdOutputPlugin.cxx | |
parent | 21dac6c05ddff1ce130843a82127618f9ed766a7 (diff) | |
download | mpd-49a3845135142ada6d581d5a6f4a5192aaed49be.tar.gz mpd-49a3845135142ada6d581d5a6f4a5192aaed49be.tar.xz mpd-49a3845135142ada6d581d5a6f4a5192aaed49be.zip |
timer: convert to class
Diffstat (limited to '')
-rw-r--r-- | src/output/HttpdOutputPlugin.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/output/HttpdOutputPlugin.cxx b/src/output/HttpdOutputPlugin.cxx index bb644c318..2c4884827 100644 --- a/src/output/HttpdOutputPlugin.cxx +++ b/src/output/HttpdOutputPlugin.cxx @@ -320,7 +320,7 @@ HttpdOutput::Open(struct audio_format *audio_format, GError **error_r) /* initialize other attributes */ clients_cnt = 0; - timer = timer_new(audio_format); + timer = new Timer(*audio_format); open = true; @@ -346,7 +346,7 @@ HttpdOutput::Close() open = false; - timer_free(timer); + delete timer; clients.clear(); @@ -398,7 +398,7 @@ httpd_output_delay(struct audio_output *ao) then httpd_output_pause() will not do anything, it will not fill the buffer and it will not update the timer; therefore, we reset the timer here */ - timer_reset(httpd->timer); + httpd->timer->Reset(); /* some arbitrary delay that is long enough to avoid consuming too much CPU, and short enough to notice @@ -406,8 +406,8 @@ httpd_output_delay(struct audio_output *ao) return 1000; } - return httpd->timer->started - ? timer_delay(httpd->timer) + return httpd->timer->IsStarted() + ? httpd->timer->GetDelay() : 0; } @@ -463,9 +463,9 @@ httpd_output_play(struct audio_output *ao, const void *chunk, size_t size, return 0; } - if (!httpd->timer->started) - timer_start(httpd->timer); - timer_add(httpd->timer, size); + if (!httpd->timer->IsStarted()) + httpd->timer->Start(); + httpd->timer->Add(size); return size; } |