diff options
author | Mke Brady <mikebrady@eircom.net> | 2015-06-01 21:38:56 +0100 |
---|---|---|
committer | Mke Brady <mikebrady@eircom.net> | 2015-06-01 21:38:56 +0100 |
commit | 54250f7552911aa92af1477531dfc8bd53437df6 (patch) | |
tree | 7643c7992d274528139ef1db40c379660d79f3af /audio_dummy.c | |
parent | e91cddabed42a24090b7808bd1d2ec2531831c6a (diff) |
Simplify init function, add defaults for latency offset and buffer size. Remove redundant timer stuff from audio_dummy.c.
Diffstat (limited to 'audio_dummy.c')
-rw-r--r-- | audio_dummy.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/audio_dummy.c b/audio_dummy.c index d7531a0..2fd8ebf 100644 --- a/audio_dummy.c +++ b/audio_dummy.c @@ -32,7 +32,7 @@ int Fs; long long starttime, samples_played; -static int init(int argc, char **argv, config_t *cfgp) { +static int init(int argc, char **argv) { return 0; } @@ -43,28 +43,14 @@ static void start(int sample_rate) { Fs = sample_rate; starttime = 0; samples_played = 0; - printf("dummy audio output started at Fs=%d Hz\n", sample_rate); + debug(1,"dummy audio output started at Fs=%d Hz\n", sample_rate); } static void play(short buf[], int samples) { - struct timeval tv; - - // this is all a bit expensive but it's long-term stable. - gettimeofday(&tv, NULL); - - long long nowtime = tv.tv_usec + 1e6*tv.tv_sec; - - if (!starttime) - starttime = nowtime; - - samples_played += samples; - - long long finishtime = starttime + samples_played * 1e6 / Fs; - usleep(finishtime - nowtime); } static void stop(void) { - printf("dummy audio stopped\n"); + debug(1,"dummy audio stopped\n"); } static void help(void) { |