[MPlayer-dev-eng] [PATCH] -vf fixpts=use_timer

Dan Oscarsson Dan.Oscarsson at tieto.com
Mon Jul 26 09:53:13 CEST 2010


On 2010-07-25 at 20:47 +0200 Rudolf Polzer wrote:
> On Sun, Jul 25, 2010 at 05:40:02PM +0200, Dan Oscarsson wrote:
> > The attached patch just enables so reordering is always done.
> > It is just my quick test code - not the way it should be done if we
> > decide to always have reordering active.
> 
> > --- libmpcodecs/dec_video.c	2010-07-25 17:31:39.567420187 +0200
> > +++ libmpcodecs/dec_video.c.org	2010-07-18 14:41:52.795937084 +0200
> > @@ -393,7 +393,7 @@
> >      unsigned int t2;
> >      double tt;
> >  
> > -    if (1 || correct_pts && pts != MP_NOPTS_VALUE) {
> > +    if (correct_pts && pts != MP_NOPTS_VALUE) {
> >          if (sh_video->num_buffered_pts ==
> >              sizeof(sh_video->buffered_pts) / sizeof(double))
> >              mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Too many buffered pts\n");
> 
> This will _always_ buffer the pts in mencoder's case, as it passes
> MP_NOPTS_VALUE which is negative-huge.  The sh_video->buffered_pts[i] < pts
> test thus will never be true, and the first for loop thus will never break.

It will break when reaching end of buffered pts values.
The MP_NOPTS_VALUE will be sorted as lowest pts value as it is a large
negative value.

> 
> > @@ -436,7 +436,7 @@
> >      else if (field_dominance == 1)
> >          mpi->fields &= ~MP_IMGFIELD_TOP_FIRST;
> >  
> > -    if (1 || correct_pts) {
> > +    if (correct_pts) {
> >          int delay = get_current_video_decoder_lag(sh_video);
> >          if (sh_video->num_buffered_pts) {
> >              sh_video->num_buffered_pts--;
> 
> This will dequeue at most one frame.
> 

It will remove one pts value in sorted order. If MP_NOPTS_VALUE was
included that will be the first value out. In the cases I have seen this
value it occurs as first frame in a sequence, and as it is sorted first,
it will also after sorting be returned as value for first frame out.

> Seriously, I have no idea WHY this works, if it works - but I'll try anyway and
> learn.
> 
> Or did you also change mencoder.c to no longer pass MP_NOPTS_VALUE, but
> sh_video->pts instead? In that case, I could see how the reordering might work.

I have not done any tests on mencoder. I have just tested it when
playing up videos in mplayer.

   Dan



More information about the MPlayer-dev-eng mailing list