[MPlayer-dev-eng] ao_plugin play() problems - fix suggestions

Stephen Davies steve at daviesfam.org
Mon Dec 10 22:19:43 CET 2001


Hi,

Problem recap:
  There's a problem with ao_plugin in that it doesn't currently handle an
  output driver that doesn't accept all the data given it.

  This has a particularly bad effect for 6 channel audio - the
  MAX_OUTBURST setting of 65536 isn't divisible by 6 channels, so
  when data is lost the result is that all the channels change places.
  Funky but undesirable...


My fix suggestions in order of importance and impact:

(1) MAX_OUTBURST should be adjusted, or maybe eliminated

- MAX_OUTBURST should at least be tweaked to a multiple of 24 bytes, so
  that when data gets lost, at least the channels stay straight.  Or,
- Better, a number like 122880 allows a bit more buffering for the
  high rate multi channel modes, and is also a multiple of common fragment
  sizes for my SBLive card, which tends to dodge the problem because
  writes most always turn out as multiples of the fragment size.  Of
  course, this is probably very card specific...

(2) ao2 drivers should limit value returned from get_space

- ao2 drivers should be adjusted to always return a get_space value that
  is less than MAX_OUTBURST, and that "suits" the driver.
  For instance, ao_oss would take fragment size into account when
  calculating a value to return.

(3) ao_plugin gets buffering

- add buffering of "unplayed" data to ao_plugins play() function.  Keep
  the data for next time.  Be careful to take into account in get_space
  and get_delay...  Downside is more copy of data; but if we make the
  MAX_OUTBURST tweaks it should be rarely needed.

What's the advice of you more experienced mplayer hackers on this?

Steve




More information about the MPlayer-dev-eng mailing list