/* * NAS audio output driver * * copyright (c) 2001 Tobias Diedrich * * Based on the libaudiooss parts rewritten by me, which were * originally based on the NAS output plugin for XMMS. * * XMMS plugin by Willem Monsuwe * adapted for libaudiooss by Jon Trulson * further modified by Erik Inge Bolsø * largely rewritten and used for this ao driver by Tobias Diedrich * * This file is part of MPlayer. * * MPlayer is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * MPlayer is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with MPlayer; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* * Theory of operation: * * The NAS consists of two parts, a server daemon and a client. * We setup the server to use a buffer of size bytes_per_second * with a low watermark of buffer_size - NAS_FRAG_SIZE. * Upon starting the flow the server will generate a buffer underrun * event and the event handler will fill the buffer for the first time. * Now the server will generate a lowwater event when the server buffer * falls below the low watermark value. The event handler gets called * again and refills the buffer by the number of bytes requested by the * server (usually a multiple of 4096). To prevent stuttering on * startup (start of playing, seeks, unpausing) the client buffer should * be bigger than the server buffer. (For debugging we also do some * accounting of what we think how much of the server buffer is filled) */ #include #include #include #include #include #include #include