[MPlayer-dev-eng] ao_plugin assumption about ao driver play()

Stephen Davies steve at daviesfam.org
Mon Dec 10 09:33:45 CET 2001


On Mon, 10 Dec 2001, Anders Johansson wrote:

> Hi,
> 
> I think understand the problem, one solution could be this. Put this
> code in ao_plugin->get_space().
> 
> sz=sz-sz%ao_plugin_data.trunc;
> 
> where trunc is a variable set by your plugin that needs buffer size
> truncation. Do not add buffering to ao_plugin when we can use the one
> in mplayer.
> 
> //Anders

Don't think this is the solution.  Its not the plugin that needs buffer
size truncation.  Its the actual output driver that may not process all
the buffer.   So - for example:

 - ao_plugin play called with 65536 bytes
 - processed through plugins, data probably changed, and maybe
   some internal state modified (delay buffers and such)
 - call driver's play()
 - output driver doesn't process all data

Now what to do with the left-over data?  Can't just pass back an
incomplete length from ao_plugin, cos then the mainline will pass the same
bytes again and cause trouble with plugins' internal state.  Seems to me
it must be stored.  (which impacts delay and space calls too).

Steve





More information about the MPlayer-dev-eng mailing list