On Wed, Jun 22, 2016 at 11:21:02AM +0200, Max Kellermann wrote:
> On 2016/06/22 11:10, Dimitris Papastamos <[email protected]> wrote:
> > Must have been an oversight when I looked at other plugin code.
> > The patch below removes the timer usage.
> 
> Please rebase.  I have conflicts.

Oops, here it is.

From 8b19f2651c7454d4f7c4b4a4e5c8c16ec73d11bf Mon Sep 17 00:00:00 2001
From: Dimitris Papastamos <[email protected]>
Date: Wed, 22 Jun 2016 10:07:52 +0100
Subject: [PATCH] sndio: No need to use a timer so get rid of it

---
 src/output/plugins/SndioOutputPlugin.cxx | 26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/src/output/plugins/SndioOutputPlugin.cxx 
b/src/output/plugins/SndioOutputPlugin.cxx
index b3f9f72..ed039e7 100644
--- a/src/output/plugins/SndioOutputPlugin.cxx
+++ b/src/output/plugins/SndioOutputPlugin.cxx
@@ -27,7 +27,6 @@
 #include "config/ConfigError.hxx"
 #include "../OutputAPI.hxx"
 #include "../Wrapper.hxx"
-#include "../Timer.hxx"
 #include "util/Error.hxx"
 #include "util/Domain.hxx"
 #include "Log.hxx"
@@ -42,7 +41,6 @@ class SndioOutput {
        AudioOutput base;
        const char *device;
        struct sio_hdl *sio_hdl;
-       Timer *timer;
 
 public:
        SndioOutput()
@@ -160,7 +158,6 @@ SndioOutput::Open(AudioFormat &audio_format, gcc_unused 
Error &error)
                goto err;
        }
 
-       timer = new Timer(audio_format);
        return true;
 err:
        sio_close(sio_hdl);
@@ -171,15 +168,6 @@ void
 SndioOutput::Close()
 {
        sio_close(sio_hdl);
-       delete timer;
-}
-
-unsigned
-SndioOutput::Delay() const
-{
-       return timer->IsStarted()
-               ? timer->GetDelay()
-               : 0;
 }
 
 size_t
@@ -187,10 +175,6 @@ SndioOutput::Play(const void *chunk, size_t size, Error 
&error)
 {
        ssize_t n;
 
-       if (!timer->IsStarted())
-               timer->Start();
-       timer->Add(size);
-
        while (1) {
                n = sio_write(sio_hdl, chunk, size);
                if (n < 0) {
@@ -203,12 +187,6 @@ SndioOutput::Play(const void *chunk, size_t size, Error 
&error)
        }
 }
 
-void
-SndioOutput::Cancel()
-{
-       timer->Reset();
-}
-
 typedef AudioOutputWrapper<SndioOutput> Wrapper;
 
 const struct AudioOutputPlugin sndio_output_plugin = {
@@ -220,11 +198,11 @@ const struct AudioOutputPlugin sndio_output_plugin = {
        nullptr,
        &Wrapper::Open,
        &Wrapper::Close,
-       &Wrapper::Delay,
+       nullptr,
        nullptr,
        &Wrapper::Play,
        nullptr,
-       &Wrapper::Cancel,
+       nullptr,
        nullptr,
        nullptr,
 };
-- 
2.8.4


_______________________________________________
mpd-devel mailing list
[email protected]
http://mailman.blarg.de/listinfo/mpd-devel

Reply via email to