[MPlayer-dev-eng] more pts

Charles Henrich henrich at sigbus.com
Fri Mar 1 03:11:38 CET 2002


Arpi, could you take a moment and explain just what exactly the skip/dup code
is doing?  Im wading through this and it just doesnt make any sense to me.

For the audio, we have a_pts set to whatever the demuxer gives up, but then
its adjusted by 

      a_pts+=(ds_tell_pts(d_audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;

Why?  If you have the timestamp of the original audio packet, and the
timestamp of the original video packet, why do you need this adjustment to put
them back together again for a skip or dup?  Also further down the code a bit,
AV_delay is computed via 

    AV_delay=(a_pts-v_pts); 

which makes sense, but then you go on to adjust it via 

    AV_delay-=mux_a->timer-(mux_v->timer-(v_timer_corr+v_pts_corr));

What are you subtracting out here?

And finally, why do you multiply the whole thing by .1?

        x=AV_delay*0.1f;  

I just dont understand what yor trying to do with this code.  

Wouldnt you only ever skip an video frame if the audio has missed a frame?
Why skip a video frame if there is a corresponding audio frame?

Wouldnt you want something like

    if(v_pts > a_pts) get_audio_frame()
    if(a_pts > v_pts) get_video_frame() 

and do the duplication as earlier in the code which is essentially:

    for(corr=current_framepts - lastframe_pts; corr > 0; corr -=frametime)
        {
        write duplicate frame;
        }

??

-Crh

       Charles Henrich         Eon Entertainment         henrich at msu.edu

                       http://www.sigbus.com:81/~henrich



More information about the MPlayer-dev-eng mailing list