[MPlayer-dev-eng] Potential source of A-V sync issues

Matthias Hopf mat at mshopf.de
Fri Feb 24 17:01:33 CET 2006


> > Actually, you are right. I overlooked that skip_flag is still zero at mencoder:1282:
> > 
> > if (v_timer_corr >= mux_frametime && (skip_limit<0 || skip_flag < skip_limit)) {
> >     v_timer_corr-=mux_frametime;
> >     ++skip_flag; // skip
> > }
> > 
> > It still looks like a bug too me - it should read skip_flag < 1 )
> 
> Are you refferring to the 'skip_limit' ?

No, I meant it should read
if (v_timer_corr >= mux_frametime && (skip_limit<0 || skip_flag < 1)) {

because skip_flag should be 0 or negative before adding to it.

> there's really no need to test 'skip_flag < 1' there, because it will 
> ALWAYS be zero there, it was inited with zero and no change is made to it 
> until that code.

IMHO it is bad style to have these implicit assumptions, when it
doesn't hurt (neither readability nor performance wise) to do the right
thing (TM).

Nevertheless, we can savely ignore this issue for now.

> Also, IMO, a more correct approach to that entire code is merging 
> v_timer_corr and v_pts_corr to a single value and testing against that...

Yep. I was wondering why they were separate in the first place.
Now that you ensured me that this isn't some concept I didn't grasp yet,
I don't have to change my patch here :->

CU

Matthias

-- 
Matthias Hopf <mhopf at suse.de>       __        __   __
Maxfeldstr. 5 / 90409 Nuernberg    (_   | |  (_   |__         mat at mshopf.de
Phone +49-911-74053-715            __)  |_|  __)  |__  labs   www.mshopf.de




More information about the MPlayer-dev-eng mailing list