/* * NAS output plugin for mplayer * * 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 * plugin by Tobias Diedrich * * 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