[MPlayer-dev-eng] vo_pts ao_pts

Felix Buenemann atmosfear at users.sourceforge.net
Sun Nov 18 02:04:42 CET 2001


On Saturday, 17. November 2001 19:38, you wrote:
> David Holm wrote:
> > Ahm,
> > I ran mplayer through ddd in hope of finding out why audio and video
> > is so out of sync when using dxr3 for playback.
> > After running a while I interrupted and checked ao_pts and vo_pts,
> > turned out that ao_pts had been =0 all the time, while vo_pts seems to
> > be updated correctly!
> > Do I have to pass a flag somewhere to get ao_pts to update or is this
> > a bug?
> >
> > //David Holm
> >
> > _______________________________________________
> > MPlayer-dev-eng mailing list
> > MPlayer-dev-eng at mplayerhq.hu
> > http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>
> I tried (in a desperate attempt) to set the ao_pts to vo_pts, and the
> dxr3 was able to playback the video helluva lot better with less sync
> loss, was still about A-V: 4-6 though, so I need a correct ao_pts!!

well it's not hard after all to find the problem, because it must be in your 
code! Look at mplayer.c around line 1198:
  ao_pts=sh_audio->timer*90000.0;
[...]
  playsize=audio_out->get_space();
  
  if(!playsize) break; // buffer is full, do not block here!!!
[...]
  playsize=audio_out->play(sh_audio->a_buffer,playsize,0);
[...]
      sh_audio->timer+=playsize/(float)(sh_audio->o_bps);
[...]

looking at my comments ao_sdl.c
// return: how many bytes can be played without blocking
static int get_space()

// plays 'len' bytes of 'data'
// it should round it down to outburst*n
// return: number of bytes played
static int play(void* data,int len,int flags)

looking at ao_dxr3.c:
Either your ioctl in get_space always fails which will always return 0 and 
skip updating of playsize so timer will never increase.

Or what I believe is failure in your play() code, you have:
static int play(void* data,int len,int flags)
{
    ioctl( fd_audio, EM8300_IOCTL_AUDIO_SETPTS, &ao_pts );
    return write(fd_audio,data,len);
}

write? yea, I'm quite sure this is no standard glibc funtion and it must be 
magically resolved at linktime through some lib. Actually it seems to be C++ 
lib function that returns an iostream.
I'm quite sure the right thing(tm) is to replace write with standard libc 
guntion fread (look at man 3 fread).

-- 
Best Regards,
	Atmos
____________________________________________
- MPlayer Developer - http://mplayerhq.hu/ -
____________________________________________



More information about the MPlayer-dev-eng mailing list