diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2014-03-05 20:31:23 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2014-03-05 20:31:23 +0000 |
commit | a18588b445edf7039f38a835c60b47c33d0d623c (patch) | |
tree | f936252291411c53ac690e57584f8bccf5755687 /usr.bin/sndiod/dev.h | |
parent | 168862ac6bddb29c173a0e1f4436f7755a4449ad (diff) |
- properly set initial position: fixes incorrect position reporting
on busy machines configured to use tiny block sizes
- run play and rec cycle in the same loop. No behavior change,
but the code is much simpler this way.
Diffstat (limited to 'usr.bin/sndiod/dev.h')
-rw-r--r-- | usr.bin/sndiod/dev.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/sndiod/dev.h b/usr.bin/sndiod/dev.h index 7a4030aa80e..a04d1caed7b 100644 --- a/usr.bin/sndiod/dev.h +++ b/usr.bin/sndiod/dev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.h,v 1.4 2014/03/05 20:24:16 ratchov Exp $ */ +/* $OpenBSD: dev.h,v 1.5 2014/03/05 20:31:22 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> * @@ -48,7 +48,6 @@ struct slot { int weight; /* dynamic range */ int maxweight; /* max dynamic range allowed */ unsigned int vol; /* volume within the vol */ - int drop; /* to drop on next read */ struct abuf buf; /* socket side buffer */ int bpf; /* byte per frame */ int slot_cmin, slot_cmax; /* slot source chans */ @@ -61,8 +60,8 @@ struct slot { void *resampbuf, *decbuf; /* tmp buffers */ } mix; struct { - int silence; /* to add on next write */ struct abuf buf; /* socket side buffer */ + int prime; /* initial cycles to skip */ int bpf; /* byte per frame */ int slot_cmin, slot_cmax; /* slot destination chans */ int dev_cmin, dev_cmax; /* device source chans */ @@ -74,6 +73,7 @@ struct slot { void *resampbuf, *encbuf; /* tmp buffers */ } sub; int xrun; /* underrun policy */ + int skip; /* cycles to skip (for xrun) */ int dup; /* mono-to-stereo and alike */ #define SLOT_BUFSZ(s) \ ((s)->appbufsz + (s)->dev->bufsz / (s)->dev->round * (s)->round) @@ -129,6 +129,11 @@ struct dev { unsigned int serial; /* for slot allocation */ /* + * current position, relative to the current cycle + */ + int delta; + + /* * desired parameters */ unsigned int reqmode; /* mode */ |