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

Arpi arpi at thot.banki.hu
Mon Dec 10 00:00:53 CET 2001


Hi,

> Looking in ao_plugin, there's an assumption in its play() that ao2 drivers
> will always play all the data they are sent.
> 
> Or, perhaps, that mplayer.c will only call it with a number that is
> already a multiple of the frag size?
> 
> This isn't true, is it?
> 
> It certainly isn't for 6 channel audio where mplayer.c sometimes calls
> ao_plugin with len=65536, not even a multiple of 6 samples...?

RTFS says:

  playsize=audio_out->play(sh_audio->a_buffer,playsize,0);

  if(playsize>0){
      sh_audio->a_buffer_len-=playsize;
	memcpy(sh_audio->a_buffer,&sh_audio->a_buffer[playsize],sh_audio->a_buffer
	sh_audio->timer+=playsize/(float)(sh_audio->o_bps);
  }

so play(0 should return the number of bytes played.
it don't have to play all bytes/samples, just return how many of them
played. notplayed bytes are kept for next cycle.


A'rpi / Astral & ESP-team

--
mailto:arpi at thot.banki.hu
http://esp-team.scene.hu



More information about the MPlayer-dev-eng mailing list