From 27536fe7c65d536ade43cf34815979484f601562 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Thu, 14 Aug 2008 09:44:16 +0000 Subject: move mix/sub underrun/overrun handling code and data in the generic abuf structure, so it can reused. Required for an audio server. No behaviour change. ok jakemsr --- usr.bin/aucat/abuf.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'usr.bin/aucat/abuf.h') diff --git a/usr.bin/aucat/abuf.h b/usr.bin/aucat/abuf.h index d7345e0dcd5..860a6c5be6b 100644 --- a/usr.bin/aucat/abuf.h +++ b/usr.bin/aucat/abuf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: abuf.h,v 1.5 2008/08/14 09:39:16 ratchov Exp $ */ +/* $OpenBSD: abuf.h,v 1.6 2008/08/14 09:44:15 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov * @@ -34,9 +34,7 @@ struct abuf { int mixvol; /* input gain */ unsigned mixdone; /* input of mixer */ unsigned mixtodo; /* output of mixer */ - unsigned mixdrop; /* frames mix_in() will discard */ unsigned subdone; /* output if sub */ - unsigned subdrop; /* silence frames sub_out() will insert */ #define XRUN_IGNORE 0 /* on xrun silently insert/discard samples */ #define XRUN_SYNC 1 /* catchup to sync to the mix/sub */ #define XRUN_ERROR 2 /* xruns are errors, eof/hup buffer */ @@ -51,9 +49,11 @@ struct abuf { unsigned start; /* offset where data starts */ unsigned used; /* valid data */ unsigned len; /* size of the ring */ + unsigned silence; /* silence to insert on next write */ + unsigned drop; /* frames to drop on next read */ struct aproc *rproc; /* reader */ struct aproc *wproc; /* writer */ - unsigned char *data; /* pointer to actual data (immediately following) */ + unsigned char *data; /* actual data (immediately following) */ }; /* -- cgit v1.2.3